Matija Cecić
/
VjezbaV5_1
6.4 Tipkalo
Embed:
(wiki syntax)
Show/hide line numbers
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 { 00007 button.rise(&toggle); // attach the address of the toggle 00008 } // function to the rising edge 00009 void toggle() 00010 { 00011 led1=!led1; 00012 }
Generated on Thu Jul 14 2022 23:36:08 by 1.7.2