Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ledBuzz = 13;
- int reedSwitch = 2;
- int switchState;
- void setup() {
- // put your setup code here, to run once:
- pinMode (ledBuzz, OUTPUT);
- pinMode (reedSwitch, INPUT);
- }
- void loop() {
- switchState = digitalRead(reedSwitch);
- if (switchState == HIGH)
- {
- digitalWrite(ledBuzz, HIGH);
- }
- else
- {
- digitalWrite(ledBuzz, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement