Given LED PinName and blink interval, spawns a thread that blinks that LED at the specified interval
Dependents: Blinky_Tests Blinky_Tests_GreenTea1
Blinky Class Reference
Interface to start a thread that blinks an LED. More...
#include <Blinky.h>
Public Member Functions | |
Blinky (PinName led, int interval) | |
Create a Blinky. | |
void | start () |
Start a thread executing blink_led. | |
void | stop () |
Terminate the thread blinking the LED. | |
Protected Member Functions | |
void | blink_led () |
Function to blink the LED. | |
Protected Attributes | |
Thread | _blinker |
Thread to execute blink_led. | |
DigitalOut | _led |
LED to blink. | |
int | _interval |
Interval of time between blinks. | |
bool | stop_blink |
Bool to stop blinking LED. |
Detailed Description
Interface to start a thread that blinks an LED.
Definition at line 28 of file Blinky.h.
Constructor & Destructor Documentation
Blinky | ( | PinName | led, |
int | interval | ||
) |
Create a Blinky.
- Parameters:
-
led A PinName, the pin name of the LED to blink interval A int, the interval of time between LED blinks
Definition at line 3 of file Blinky.cpp.
Member Function Documentation
void blink_led | ( | ) | [protected] |
Function to blink the LED.
Definition at line 15 of file Blinky.cpp.
void start | ( | ) |
Start a thread executing blink_led.
Definition at line 8 of file Blinky.cpp.
void stop | ( | ) |
Terminate the thread blinking the LED.
Definition at line 11 of file Blinky.cpp.
Field Documentation
bool stop_blink [protected] |
Generated on Tue Jul 12 2022 19:56:34 by 1.7.2