/*
29/01/2019
Written by: Gabby Shimoni
Description:
This program read two push buttons and print their state to serial monitor
*/
#define pb1Pin 9
#define pb2Pin 10
int pb1Value = 0;
int pb2Value = 0;
void setup() {
Serial.begin(9600);
pinMode(pb1Pin,INPUT);
pinMode(pb2Pin,INPUT);
}
void loop() {
pb1Value = digitalRead(pb1Pin);
pb2Value = digitalRead(pb2Pin);
Serial.print("pb1="); Serial.print(pb1Value);
Serial.print("pb2="); Serial.println(pb2Value);
delay(100);
}
Comments