takuya ichise
/
NEOPIXEL_SAMPLE
NeoPixel sample
Revision 0:124662fe9af9, committed 2020-01-02
- Comitter:
- tichise
- Date:
- Thu Jan 02 07:57:58 2020 +0000
- Commit message:
- NeoPixel sample
Changed in this revision
diff -r 000000000000 -r 124662fe9af9 NeoPixel.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NeoPixel.lib Thu Jan 02 07:57:58 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/tichise/code/NeoPixel/#415459e3f93b
diff -r 000000000000 -r 124662fe9af9 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 02 07:57:58 2020 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "neopixel.h" + + +NeoPixelOut neoPixel(p11); + +int main() { + wait(0.2); // wait for HSE to stabilize + + neoPixel.global_scale = 1.0f; // Adjust brightness + neoPixel.normalize = true; // Equalize brightness to make r + g + b = 255 + + Pixel pixels[6]; + pixels[0].hex = 0xFF0000; + pixels[1].hex = 0xFFFF00; + pixels[2].hex = 0x00FF00; + pixels[3].hex = 0x00FFFF; + pixels[4].hex = 0x0000FF; + pixels[5].hex = 0xFF00FF; + + neoPixel.send(pixels, 6); + + while(1); +} \ No newline at end of file
diff -r 000000000000 -r 124662fe9af9 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jan 02 07:57:58 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file