Replacement product: 53026
DiGrove is Didels Grove on steroides. The DiGrove modules aspire to extend the fantastic Grove ecosystem by new, innovative and fascinating modules. Primarily designed for education and development, the modules are also handy for all sorts of DIY projects.
This module can be used as an input for 2 switches, or as 2 leds. You can even make both at the same time, the software can read the switch while the led is blinking. Depressing the switch will always light the led, but protection resistors avoid excessive current in case of collision.
You may be surprised to see a resistor in parallel to the the LED. This is not required at 5V, but is safer at 3V: the red led induces a voltage drop of 1.5V, hence the high level is 1.5V and not 3V.
If the microcontroller is programmed in input mode:
Button depressed, reads out a "0" (LOW)
Button released, reads out a "1" (HIGH)
No need to set the internal pull-up, but it is allowed.
If the microcontroller is programmed in output mode:
If a "0" (LOW) is written, the LED is ON, current is ~1mA.
If a "1" (HIGH) is written, the LED is OFF, and no current flows.
But if the button is depressed, the LED lights, and a "short circuit" current of 5mA must be given by the pin which is not a
problem for microcontroller applications.
Programming a button offers many possibilities. The static operation is evident, but detecting dynamic actions (transition off-on, durations, counting bursts, successive actions like morsecode) are exellent (and useful) exercises to understand C programming.
DiGrove modules come in a normed footprind and they can easily be fixed into a simple rail:
This helps debugging the wiring and keeps your prototype or experiment on the smallest possible.