Publishing test
Dependencies: mbed wave_player mbed-rtos 4DGL-uLCD-SE SDFileSystem_OldbutworkswithRTOS
RGBLed/RGBLed.cpp@2:b07b1a448161, 2019-02-23 (annotated)
- Committer:
- kanicolaus
- Date:
- Sat Feb 23 20:24:29 2019 +0000
- Revision:
- 2:b07b1a448161
Testing "publishing" function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kanicolaus | 2:b07b1a448161 | 1 | #include "RGBLed.h" |
kanicolaus | 2:b07b1a448161 | 2 | #include "mbed.h" |
kanicolaus | 2:b07b1a448161 | 3 | |
kanicolaus | 2:b07b1a448161 | 4 | RGBLed::RGBLed (PinName redpin, PinName greenpin, PinName bluepin) |
kanicolaus | 2:b07b1a448161 | 5 | : _redpin(redpin), _greenpin(greenpin), _bluepin(bluepin) |
kanicolaus | 2:b07b1a448161 | 6 | { |
kanicolaus | 2:b07b1a448161 | 7 | //50Hz PWM clock default a bit too low, go to 2000Hz (less flicker) |
kanicolaus | 2:b07b1a448161 | 8 | _redpin.period(0.0005); |
kanicolaus | 2:b07b1a448161 | 9 | } |
kanicolaus | 2:b07b1a448161 | 10 | |
kanicolaus | 2:b07b1a448161 | 11 | void RGBLed::write(float red,float green, float blue) |
kanicolaus | 2:b07b1a448161 | 12 | { |
kanicolaus | 2:b07b1a448161 | 13 | _redpin = red; |
kanicolaus | 2:b07b1a448161 | 14 | _greenpin = green; |
kanicolaus | 2:b07b1a448161 | 15 | _bluepin = blue; |
kanicolaus | 2:b07b1a448161 | 16 | } |