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: Hotboards_leds mbed
Fork of writing by
main.cpp
00001 00002 /* 00003 * This program blinks a led but this time we will show you 00004 * how to use the write function to manipulate the led state 00005 * according to a variable value 00006 * 00007 */ 00008 00009 #include "mbed.h" 00010 #include "Hotboards_leds.h" 00011 00012 //bitRead macro taken from arduino 00013 #define bitRead( var, bit ) (((var) >> (bit)) & 0x01) 00014 00015 Hotboards_leds led( PA_5 ); 00016 00017 uint8_t counter; 00018 00019 int main() 00020 { 00021 while(1) 00022 { 00023 //The led will blink because we are writing the LSB 00024 //of the variable counter which on each iteration 00025 //is incremented by 1. 00026 led.write( bitRead( counter , 0 ) ); 00027 wait_ms( 200 ); 00028 counter ++; 00029 } 00030 }
Generated on Tue Jul 26 2022 09:14:56 by
1.7.2
