Slide 43
Slide 43 text
int switchPin = 7;
!
void setup() {
pinMode( switchPin, INPUT_PULLUP);
Serial.begin( 9600 );
}
!
void loop() {
int switchValue;
switchValue = digitalRead( switchPin );
!
Serial.println( switchValue );
delay( 300 ); // slow down to make it easier to read
}