PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
Examples
PropWare_WS2812
WS2812_Demo.cpp
Go to the documentation of this file.
1
26
#include <
PropWare/ws2812.h
>
27
28
const
PropWare::Pin::Mask
LED_TX_PIN_MASK =
PropWare::Pin::P27
;
36
int
main
() {
37
const
PropWare::WS2812
led
(LED_TX_PIN_MASK,
PropWare::WS2812::GRB
);
38
39
const
int
delay = 40 * MILLISECOND;
40
while
(1) {
41
unsigned
int
i;
42
43
// Go bright
44
for
(i = 0; i < 0x101010; i += 0x010101) {
45
led
.send(i);
46
waitcnt(delay + CNT);
47
}
48
49
// Go dim
50
for
(; i; i -= 0x010101) {
51
led
.send(i);
52
waitcnt(delay + CNT);
53
}
54
}
55
}
56
PropWare::WS2812::GRB
Definition:
ws2812.h:44
PropWare::Port::P27
Definition:
port.h:68
PropWare::Port::Mask
Mask
Definition:
port.h:40
main
int main(void)
Definition:
GraphicsTest.c:20
ws2812.h
PropWare::WS2812
An easy-to-use, cheap, small, and bright multicolor LED capable of being strung together in a lengthy...
Definition:
ws2812.h:36
led
void led(int n, int state)
Set a blue LED (from 0 to 5) to a state (ON or OFF). Examples: led(1, ON) turns the blue LED next to ...
Definition:
leds_led.c:9
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12