Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 9, 2019 02:26
Show Gist options
  • Save surinoel/5b9740d585246bde570391a208ecc869 to your computer and use it in GitHub Desktop.
Save surinoel/5b9740d585246bde570391a208ecc869 to your computer and use it in GitHub Desktop.
int pinReed = 2;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(pinReed, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(pinReed)) {
Serial.println("Mini Reed OFF");
}
else {
Serial.println("Mini Reed ON");
}
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment