Internal Pull Up
http://mbed.org/users/4180_1/notebook/pushbuttons/
Mbed has special inputs that can be programmed to provide an internal pullup resistor and eliminate the need to add an external resistor when hooking up pushbuttons and switches. To use it, on a DigitalIn pin set the mode to pullup with pin.mode(PullUp);, and leave out the external resistor. The switch is then connected to the input pin and the other switch connection is tied to ground. While the focus here is on pushbuttons, the same techniques will apply to the use of other switches such as the individual switches found in a DIP switch.
Example for digital Out
#include "mbed.h" DigitalOut myled(LED1); DigitalOut Ctrl(p8); int main() { while(1) { Ctrl = 1; myled = 1; wait(2); Ctrl = 0; myled = 0; wait(2); } }
4 comments on Internal Pull Up:
Please log in to post comments.
Will this work for I2C as well ?