jim hamblen
/
Pushbutton_Demo
Pushbutton demo using internal pullup feature
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut myled(LED1); 00004 DigitalIn pb(p8); 00005 // SPST Pushbutton demo using internal PullUp function 00006 // no external PullUp resistor needed 00007 // Pushbutton from P8 to GND. 00008 int main() { 00009 pb.mode(PullUp); 00010 while(1) { 00011 myled = pb; 00012 } 00013 }
Generated on Wed Jul 13 2022 05:38:16 by 1.7.2