How to use a Reed Switch
Physical Computing
Tutorials
...eed switch
const int LED_PIN = 13; // LED pin - active-high
void ... setup()
{
Serial.begin(9600);
// Since the other end of the reed switch is connected to ground, we need
// to pull-up the reed switch pin internally.
pinMode(REED_PIN, INPUT_PUL...