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
main.cpp
- Committer:
- RomanValenciaP
- Date:
- 2016-02-29
- Revision:
- 0:a0ed46c36cdc
File content as of revision 0:a0ed46c36cdc:
/*
* This program blinks a led but this time we will show you
* how to use the write function to manipulate the led state
* according to a variable value
*
*/
#include "mbed.h"
#include "Hotboards_leds.h"
//bitRead macro taken from arduino
#define bitRead( var, bit ) (((var) >> (bit)) & 0x01)
Hotboards_leds led( PA_5 );
uint8_t counter;
int main()
{
while(1)
{
//The led will blink because we are writing the LSB
//of the variable counter which on each iteration
//is incremented by 1.
led.write( bitRead( counter , 0 ) );
wait_ms( 200 );
counter ++;
}
}