DP / Mbed 2 deprecated LooksLikeTrySwitch

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut ledB(LED1);
00004 InterruptIn button1(p15);
00005 
00006 void lighton()
00007 {
00008     ledB = 0;
00009 }
00010 void lightoff()
00011 {
00012     ledB = 1;
00013 }
00014 
00015 int main()
00016 {
00017     ledB = 1;
00018     button1.mode(PullUp);
00019     button1.fall(&lighton);
00020     button1.rise(&lightoff);
00021     while(1)
00022     {
00023         
00024     }
00025 }