turning a led ON and OFF
Dependencies: Hotboards_leds mbed
main.cpp@1:624cca427a70, 2016-03-15 (annotated)
- Committer:
- RomanValenciaP
- Date:
- Tue Mar 15 18:53:47 2016 +0000
- Revision:
- 1:624cca427a70
- Parent:
- 0:b5cfc5f155cb
added header info, authors and contact info
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RomanValenciaP | 0:b5cfc5f155cb | 1 | |
RomanValenciaP | 1:624cca427a70 | 2 | /* Library: Hotboards_leds.h |
RomanValenciaP | 1:624cca427a70 | 3 | * Project: led |
RomanValenciaP | 1:624cca427a70 | 4 | * File: main.cpp |
RomanValenciaP | 1:624cca427a70 | 5 | * Author: Diego Perez |
RomanValenciaP | 1:624cca427a70 | 6 | * Modified by: Roman Valencia |
RomanValenciaP | 1:624cca427a70 | 7 | * Contact: http://www.hotboards.org/ |
RomanValenciaP | 1:624cca427a70 | 8 | * |
RomanValenciaP | 0:b5cfc5f155cb | 9 | * The simplest program I, blink a led on pin PA_5 |
RomanValenciaP | 0:b5cfc5f155cb | 10 | * |
RomanValenciaP | 0:b5cfc5f155cb | 11 | */ |
RomanValenciaP | 0:b5cfc5f155cb | 12 | |
RomanValenciaP | 0:b5cfc5f155cb | 13 | #include "mbed.h" |
RomanValenciaP | 0:b5cfc5f155cb | 14 | #include "Hotboards_leds.h" |
RomanValenciaP | 0:b5cfc5f155cb | 15 | |
RomanValenciaP | 0:b5cfc5f155cb | 16 | //Creates a simple led object |
RomanValenciaP | 0:b5cfc5f155cb | 17 | Hotboards_leds led( PA_5 ); |
RomanValenciaP | 0:b5cfc5f155cb | 18 | |
RomanValenciaP | 0:b5cfc5f155cb | 19 | int main() |
RomanValenciaP | 0:b5cfc5f155cb | 20 | { |
RomanValenciaP | 0:b5cfc5f155cb | 21 | while(1) |
RomanValenciaP | 0:b5cfc5f155cb | 22 | { |
RomanValenciaP | 0:b5cfc5f155cb | 23 | //Turns ON led |
RomanValenciaP | 0:b5cfc5f155cb | 24 | led.turnOn( ); |
RomanValenciaP | 0:b5cfc5f155cb | 25 | wait_ms( 100 ); |
RomanValenciaP | 0:b5cfc5f155cb | 26 | //Turns OFF led |
RomanValenciaP | 0:b5cfc5f155cb | 27 | led.turnOff( ); |
RomanValenciaP | 0:b5cfc5f155cb | 28 | wait_ms( 100 ); |
RomanValenciaP | 0:b5cfc5f155cb | 29 | } |
RomanValenciaP | 0:b5cfc5f155cb | 30 | } |