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: PixelArray WordClock_de ds3231 mbed
Fork of mbed_ws2812b by
main.cpp
- Committer:
- charly
- Date:
- 2017-11-05
- Revision:
- 2:d39f37d64441
- Parent:
- 1:23535cfbf924
- Child:
- 3:ebe0c4fa97b8
File content as of revision 2:d39f37d64441:
// Wordclock with WS2812-LED-Stripe
// with 11x10 LED-Matrix and 4 minute-LEDS
/*
ESKISTLFÜNF
ZEHNZWANZIG
DREIVIERTEL
TGNACHVORJM
HALBXZWÖLFP
ZWEINSIEBEN
KDREIRHFÜNF
ELFNEUNVIER
WACHTZEHNRS
BSECHSFMUHR
****
*/
#include "mbed.h"
#include "neopixel.h"
#include "WordClock.h"
// brigtness beween 0 and 1.0
#define BRIGHTNESS 0.5
int main()
{
// WordClock object with leds connected to p5 (MOSI)
WordClock clock(p5);
Timer timer;
time_t now;
{
timer.start();
while(1) {
// all words
for (int i=1; i<=NUMWORDS;i++) {
clock.test_display(3,i);
wait_ms(800);
}
//all leds on with rainbow colors
while ( int(timer.read()/10.0) %2 == 0) {
clock.test_display(1);
wait_ms(100);
}
// every led on for 250ms
for (int i=0; i<NUMLEDS;i++) {
clock.test_display(2,i);
wait_ms(250);
}
timer.reset();
}
}
}
