Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem mbed
Fork of PES4_Programme by
Diff: source/functions.cpp
- Revision:
- 95:b02e1b2a6cbd
- Parent:
- 85:04fe3dff23f4
--- a/source/functions.cpp Tue Apr 10 07:47:18 2018 +0000 +++ b/source/functions.cpp Wed Apr 11 15:19:22 2018 +0000 @@ -3,18 +3,18 @@ void setLED(char button, uint32_t color) { /* 0xFF - 4095, 0x00 - 0 -> factor 1/16.06 */ - float red = ((color >> 16) & 0xff)/16.06; - float green = ((color >> 8) & 0xff)/16.06; - float blue = (color & 0xff)/16.06; + uint16_t red = (uint16_t)(((color >> 16) & 0xff)<<4); + uint16_t green = (uint16_t)(((color >> 8) & 0xff)<<4); + uint16_t blue = (uint16_t)((color & 0xff)<<4); /* PWM channel 10-15, Button is 0 or 1 * -> if Button = 0, set Channel 10,11,12 * -> if Button = 1, set Channel 13,14,15 */ - setPWM(10+(3*button) , red); - setPWM(10+(3*button)+1 , green); - setPWM(10+(3*button)+2 , blue); + setPWM(9+(3*button) , red); + setPWM(9+(3*button)+1 , green); + setPWM(9+(3*button)+2 , blue); }