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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:c6a3423a8d24
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 14 19:33:32 2022 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" + +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +DigitalOut led4(LED4); +Ticker flipper1; +Ticker flipper2; +Ticker flipper3; +Ticker flipper4; +void flip1() { + led1 = !led1; +} +void flip2() { + led2 = !led2; +} +void flip3() { + led3 = !led3; +} +void flip4() { + led4 = !led4; +} + +int main() { + led1 = 1; + led2 = 1; + led3 = 1; + led4 = 1; + flipper1.attach(&flip1, 1.0); + flipper2.attach(&flip2, 2.0); + flipper3.attach(&flip3, 4.0); + flipper4.attach(&flip4, 8.0); + while(1) { + + } +}