forked from jandelgado/jled
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for mbed framework (jandelgado#45)
- Loading branch information
1 parent
7219c3a
commit 45510b6
Showing
30 changed files
with
460 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.pio/ | ||
**/.vscode | ||
test/bin | ||
test/.depend | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test/* | ||
examples/* | ||
doc/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Multi LED example for mbed | ||
|
||
This example controls 4+1 LEDs, showing different effects, yet all synchronized: | ||
|
||
* blue LED: breathe (period 2s) | ||
* green LED: blink (0.75s on/0.25s off) | ||
* red LED: fade off (period 1s) | ||
* yellow LED: fade on (period 1s) | ||
* built-in LED: blink (0.5s on/0.5s off) | ||
|
||
## Wiring | ||
|
||
The example uses a STM32 Nucleo F401RE and is wired like shown: | ||
|
||
![mutliled](../../doc/multiled_mbed_bb.png) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// JLed multi LED demo for mbed. Controls multiple LEDs parallel in-sync. | ||
// | ||
// mbed version tested with ST Nucleo F401RE | ||
// | ||
// See https://os.mbed.com/platforms/ST-Nucleo-F401RE/ for pin names and | ||
// assignments. | ||
// | ||
// Copyright 2020 by Jan Delgado. All rights reserved. | ||
// https://github.com/jandelgado/jled | ||
// | ||
#include <jled.h> | ||
#include <mbed.h> | ||
|
||
int main() { | ||
JLed leds[] = {JLed(LED1).Blink(750, 250).Forever(), | ||
JLed(PA_8).Breathe(2000).Forever(), | ||
JLed(PB_10).FadeOff(1000).Forever(), | ||
JLed(PB_4).FadeOn(1000).Forever(), | ||
JLed(PB_3).Blink(500, 500).Forever()}; | ||
|
||
JLedSequence sequence(JLedSequence::eMode::PARALLEL, leds); | ||
|
||
while (1) { | ||
sequence.Update(); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.