Back to the beginning BYOB Party #1, "Bring you own Bulbs" - The Internet of Holiday Lights
OK, so one thing I could not find in all the searching was a Library for the infineon Board so I made one from the sample code, it is not 100% complete yet (More features to add) but its all working so I thought I would share it with you all so you can use it if you so desire
I have moved all the functions into a library called "Infineon"
Added a function to directly set colours "SETCOLOUR(RED)" for example, so far it only has a few colours defined but If i can get a list of RGB values for LED colours 12 bit per colour then I will be happy to add them to this
Colours are White, Silver, Gray, Black, Red, Maroon, Yellow, Olive, Lime, Green, Aqua, Teal, Blue, Navy, Fuchsia, Purple but of course some dont look right on LEDS so i need to refine it over time, if you have some good colour definitions please contribute
This is the modified main loop so you can see how much cleaner it is, it of course can be improved further but this is just a test
// the loop routine runs over and over again forever: void loop() { // change lamp colour to red RGBLEDS.I2CWRITE6BYTES(ADDRESS, INTENSITY_RGB, 0x0, 0x0, 0x0); // all off delay(500); // wait 1000ms // change lamp colour to green RGBLEDS.I2CWRITE6BYTES(ADDRESS, INTENSITY_RGB, 0x03ff, 0x03FF, 0x03FF); // 25% delay(500); // change lamp colour to blue RGBLEDS.I2CWRITE6BYTES(ADDRESS, INTENSITY_RGB, 0x07ff, 0x07ff, 0x07ff); // Blue delay(500); RGBLEDS.I2CWRITE6BYTES(ADDRESS, INTENSITY_RGB, 0x0bff, 0x0bff, 0x0bff); // Blue delay(500); RGBLEDS.I2CWRITE6BYTES(ADDRESS, INTENSITY_RGB, 0x0fff, 0x0fff, 0x0fff); // Blue delay(500); // White, Silver, Gray, Black, Red, Maroon, Yellow, Olive, Lime, Green, Aqua, Teal, Blue, Navy, Fuchsia, Purple RGBLEDS.SETCOLOUR( White); delay(500); RGBLEDS.SETCOLOUR(Silver ); delay(500); RGBLEDS.SETCOLOUR(Gray ); delay(500); RGBLEDS.SETCOLOUR(Black ); delay(500); RGBLEDS.SETCOLOUR(Red ); delay(500); RGBLEDS.SETCOLOUR(Maroon ); delay(500); RGBLEDS.SETCOLOUR(Yellow ); delay(500); RGBLEDS.SETCOLOUR(Olive ); delay(500); RGBLEDS.SETCOLOUR(Lime ); delay(500); RGBLEDS.SETCOLOUR(Green ); delay(500); RGBLEDS.SETCOLOUR(Aqua ); delay(500); RGBLEDS.SETCOLOUR( Teal); delay(500); RGBLEDS.SETCOLOUR(Blue ); delay(500); RGBLEDS.SETCOLOUR(Navy ); delay(500); RGBLEDS.SETCOLOUR(Fuchsia ); delay(500); RGBLEDS.SETCOLOUR(Purple ); delay(500); }
The cycle looks like this
Code is attached for your pleasure
Top Comments