This came up in office hours — the video is a bit informal — but the explanation is ok. No titles or edits — maybe will add those later?
The goal here is to get a copper tape switch like we made in class during week 3 talking to your Arduino.
Video
Get the code on github . File is called copperTapeSwitch_
Add Code
// digital input
int buttonPin = 3;
int buttonState = 0;
void setup() {
// put your setup code here, to run once:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(buttonPin);
Serial.println( buttonState);
}