15 lines
304 B
C++
15 lines
304 B
C++
#define PIN_INPUT 2
|
|
#define PIN_LED 13
|
|
|
|
void setup() {
|
|
Serial.begin(9600);
|
|
pinMode(PIN_INPUT, INPUT);
|
|
pinMode(PIN_LED, OUTPUT);
|
|
}
|
|
|
|
void loop() {
|
|
int sensorVal = digitalRead(PIN_INPUT);
|
|
Serial.print(sensorVal); // Выводим значение в мониторе порта 3
|
|
delay(500);
|
|
}
|