![](/media/cache/profiles/IMG_0710-2.jpg.50x50_q85.jpg)
Light Show library for organic, calm, light display.
Dependencies: BLE_API mbed nRF51822
Fork of mbed_blinky by
main.cpp
- Committer:
- nargetdev
- Date:
- 2015-10-10
- Revision:
- 8:5ed23e276c8a
- Parent:
- 4:81cea7a352b0
- Child:
- 9:1bd0f7a2ee71
File content as of revision 8:5ed23e276c8a:
#include "mbed.h" typedef unsigned char byte; //PwmOut blue(p18); //PwmOut green(p19); DigitalOut red(p18); DigitalOut green(p19); DigitalOut blue(p20); void error_code(){ for(;;){ green = !green; blue = !blue; red = !red; wait(.5); } } void primative_channel(int rgb, byte duty){ for (byte i = 0; i < 255; i++){ switch (rgb){ case 'r': red = ( i < duty ); break; case 'g': green = (i < duty); break; case 'b': blue = (i < duty); break; default: error_code(); } } } int main() { while(1){ primative_channel('g',20); primative_channel('b',150); for (int i = 0; i < 256; i++){ primative_channel('b',i); } } }