Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
example1.h
00001 00002 /* Example using a Ricker to make a callback to a C style function */ 00003 00004 #include "mbed.h" 00005 #include "Ricker.h" 00006 00007 DigitalOut led1(LED1); 00008 DigitalOut led2(LED2); 00009 DigitalOut led3(LED3); 00010 DigitalOut led4(LED4); 00011 00012 Ticker t1; // Standard Mbed Ticker 00013 Ticker t2; // Standard Mbed Ticker 00014 Ricker r3; // A Ricker 00015 Ricker r4; // A Ricker 00016 00017 void cb1(void) { led1 = !led1; } 00018 void cb2(void) { led2 = !led2; } 00019 void cb3(void) { led3 = !led3; } 00020 void cb4(void) { led4 = !led4; } 00021 00022 int main() { 00023 00024 led1 = 1; 00025 led3 = 1; 00026 00027 t1.attach(&cb1, 0.25); 00028 t2.attach(&cb2, 0.25); 00029 r3.attach(&cb3, 0.25); 00030 r4.attach(&cb4, 0.25); 00031 00032 while(1) { } 00033 }
Generated on Wed Jul 13 2022 20:31:44 by
1.7.2