A Reed Switch is a switch with a difference. It behaves like a push-to-make switch, but it isn’t controlled using pressure. Instead, when a magnet is placed nearby, the switch closes, and then when the magnet is moved away, the switch opens again.
It requires a power output from the Crumble (+), and then a connection to an input (A, B, C or D). When a magnet is placed near the Reed Switch, the input to the Crumble becomes HI, otherwise it is LO.
Note: Don’t forget you will need to add batteries.
We use this block to monitor our chosen input. Whenever the button is pressed, current will be going through your chosen input e.g. B. You can change the options by clicking the letter or HI.
In this code, whenever a magnet is placed near the reed switch, the motor will run forwards, otherwise it will stop. It will do this indefinitely.
Here is the reed switch in action.