Applied engineering Team / Mbed 2 deprecated Vt2Matija_Berecektipkalo

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 InterruptIn button(p18); // Interrupt on digital pushbutton input p18
00003 DigitalOut led1(p5); // digital out to p5
00004 void toggle(void); // function prototype
00005 int main() {
00006 button.rise(&toggle); // attach the address of the toggle
00007 } // function to the rising edge
00008 void toggle() {
00009 led1=!led1;
00010 }