osd-contiki/examples/osd/lgb-train/Grove_LED_Bar-master/LP examples/Random/Random.ino
2017-07-20 10:33:19 +02:00

29 lines
684 B
C++

/*
Grove LED Bar - Random Example
This example will show you how to use setBits() function of this library.
Set any combination of LEDs using 10 bits.
Ported for MSP-EXP430F5529 TM4c123 (Tiva C) LaunchPad By Cameron P. LaFollette
*/
#include <Grove_LED_Bar.h>
// Arduino Clock pin, Data pin, Orientation
// Grove_LED_Bar bar(9, 8, 0); // Clock pin, Data pin, Orientation
// LaunchPad Clock pin, Data pin, Orientation
Grove_LED_Bar bar(35, 36, 0); // Clock pin, Data pin, Orientation
void setup()
{
// nothing to initialize
bar.begin();
}
void loop()
{
// Display a random value between 0 (all LEDs off) and 1023 (all LEDs on)
bar.setBits(random(1024));
delay(50);
}