222/sketch_mar22a/sketch_mar22a.ino

13 lines
501 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

void setup (){
Serial.begin(9600);
pinMode(A0, INPUT); // к входу A0 подключаем потенциометр
pinMode(A1, INPUT); // к входу A1 подключаем gpu
}
void loop (){
int valuePotentiometer = analogRead(A0); // считываем данные с порта A0
int valueGPU = digitalRead(A1);
char varJson[64];
sprintf(varJson, "{\"valuePotentiometer\": %d, \"valueGPU\": %d}", valuePotentiometer, valueGPU);
Serial.println(varJson);
}