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
source/functions.cpp@11:e8a7a4a9af05, 2018-03-26 (annotated)
- Committer:
- cittecla
- Date:
- Mon Mar 26 08:21:27 2018 +0000
- Revision:
- 11:e8a7a4a9af05
- Parent:
- 10:1f327f8aa4dd
- Child:
- 12:f28a798d2661
-implemented setLED with hex rgb code ; -changed pwm duty-cycle to float
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aeschsim | 8:6ece7caefb33 | 1 | #include "functions.h" |
aeschsim | 8:6ece7caefb33 | 2 | |
cittecla | 11:e8a7a4a9af05 | 3 | void setLED(char button, uint32_t color) |
cittecla | 11:e8a7a4a9af05 | 4 | { |
cittecla | 11:e8a7a4a9af05 | 5 | float red = ((color >> 16) & 0xff)/2.55; |
cittecla | 11:e8a7a4a9af05 | 6 | float green = ((color >> 8) & 0xff)/2.55; |
cittecla | 11:e8a7a4a9af05 | 7 | float blue = (color & 0xff)/2.55; |
cittecla | 11:e8a7a4a9af05 | 8 | |
cittecla | 11:e8a7a4a9af05 | 9 | //PWM channel 9-15 |
cittecla | 11:e8a7a4a9af05 | 10 | setPWM(9+(3-3*button) , red); |
cittecla | 11:e8a7a4a9af05 | 11 | setPWM(9+(3-3*button)+1 , green); |
cittecla | 11:e8a7a4a9af05 | 12 | setPWM(9+(3-3*button)+2 , blue); |
cittecla | 11:e8a7a4a9af05 | 13 | |
cittecla | 11:e8a7a4a9af05 | 14 | } |
aeschsim | 8:6ece7caefb33 | 15 | void setValvePosition(char pos) {} |