Simple test application for the STMicroelectronics X-NUCLEO-LED61A1 LED Control Expansion Board.
Dependencies: X_NUCLEO_LED61A1 mbed
Fork of HelloWorld_LED61A1 by
LED Control with the X-NUCLEO-LED61A1 Expansion Board
This application provides a simple example of usage of the X-NUCLEO-LED61A1 LED Control Expansion Board.
It shows how to control a LED stripe load connected to the board by means of a sinusoidal wave form injected into the PWM dimming control pin.
Diff: main.cpp
- Revision:
- 18:bef2ec6d10ab
- Parent:
- 16:0d6f96345c56
- Child:
- 19:4b259f97c1e3
diff -r a338619c7cab -r bef2ec6d10ab main.cpp
--- a/main.cpp Mon May 08 16:17:18 2017 +0000
+++ b/main.cpp Thu Jul 13 16:15:24 2017 +0000
@@ -152,8 +152,9 @@
/* Initializing LED Control Component. */
led = new Led6001(D4, A3, D6, D5);
- if (led->init() != COMPONENT_OK)
+ if (led->init() != COMPONENT_OK) {
exit(EXIT_FAILURE);
+ }
/* Attaching interrupt request functions. */
led->attach_xfault_irq(&xfault_irq);
@@ -167,14 +168,11 @@
/*----- LED Control. -----*/
/* Either performing the component handler, interrupt handlers, or waiting for events. */
- while (true)
- {
- if (ticker_irq_triggered)
- {
+ while (true) {
+ if (ticker_irq_triggered) {
ticker_irq_triggered = false;
led_handler();
- } else if (xfault_irq_triggered)
- {
+ } else if (xfault_irq_triggered) {
xfault_irq_triggered = false;
xfault_handler();
} else {

X-NUCLEO-LED61A1 LED Driver