![](/media/cache/profiles/25a76ba89c58a499eadfd4cb8ecf8af5.jpg.50x50_q85.jpg)
Program to demo the easyNeo class
main.cpp@0:8b36d99af4c3, 2015-02-15 (annotated)
- Committer:
- dannellyz
- Date:
- Sun Feb 15 21:32:19 2015 +0000
- Revision:
- 0:8b36d99af4c3
- Child:
- 1:9a5fbfa38676
round 1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dannellyz | 0:8b36d99af4c3 | 1 | #include "mbed.h" |
dannellyz | 0:8b36d99af4c3 | 2 | //Include both of the following to use easyNeo class |
dannellyz | 0:8b36d99af4c3 | 3 | #include "neopixel.h" |
dannellyz | 0:8b36d99af4c3 | 4 | #include "easyNeo.h" |
dannellyz | 0:8b36d99af4c3 | 5 | |
dannellyz | 0:8b36d99af4c3 | 6 | //Innitialize easyNeo simple with the number of LEDs in the grouping |
dannellyz | 0:8b36d99af4c3 | 7 | easyNeo neoTest(3); |
dannellyz | 0:8b36d99af4c3 | 8 | |
dannellyz | 0:8b36d99af4c3 | 9 | int main() |
dannellyz | 0:8b36d99af4c3 | 10 | { |
dannellyz | 0:8b36d99af4c3 | 11 | |
dannellyz | 0:8b36d99af4c3 | 12 | //for easy adding: |
dannellyz | 0:8b36d99af4c3 | 13 | //red = FF0000 |
dannellyz | 0:8b36d99af4c3 | 14 | //green = 00FF00 |
dannellyz | 0:8b36d99af4c3 | 15 | //blue = 0000FF |
dannellyz | 0:8b36d99af4c3 | 16 | //off = 000000 |
dannellyz | 0:8b36d99af4c3 | 17 | while (1) { |
dannellyz | 0:8b36d99af4c3 | 18 | neoTest.clear(); |
dannellyz | 0:8b36d99af4c3 | 19 | neoTest.lightTest(); |
dannellyz | 0:8b36d99af4c3 | 20 | wait(1); |
dannellyz | 0:8b36d99af4c3 | 21 | neoTest.clear(); |
dannellyz | 0:8b36d99af4c3 | 22 | neoTest.setByHex("FF0000000000000000"); |
dannellyz | 0:8b36d99af4c3 | 23 | wait(1); |
dannellyz | 0:8b36d99af4c3 | 24 | neoTest.clear(); |
dannellyz | 0:8b36d99af4c3 | 25 | neoTest.setByHex("0000000000FF000000"); |
dannellyz | 0:8b36d99af4c3 | 26 | wait(1); |
dannellyz | 0:8b36d99af4c3 | 27 | neoTest.clear(); |
dannellyz | 0:8b36d99af4c3 | 28 | neoTest.setByHex("00000000000000FF00"); |
dannellyz | 0:8b36d99af4c3 | 29 | wait(1); |
dannellyz | 0:8b36d99af4c3 | 30 | neoTest.clear(); |
dannellyz | 0:8b36d99af4c3 | 31 | |
dannellyz | 0:8b36d99af4c3 | 32 | |
dannellyz | 0:8b36d99af4c3 | 33 | } |
dannellyz | 0:8b36d99af4c3 | 34 | } |