RGB LED (PWM)
Dependents: FRDM-KL46Z_SENSORDIG_HUMTEMP
RGBLed.cpp@0:627ea7b55fe3, 2019-05-31 (annotated)
- Committer:
- MayraPeA
- Date:
- Fri May 31 00:29:55 2019 +0000
- Revision:
- 0:627ea7b55fe3
Sensor de temperatura y humedad (DHT22)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MayraPeA | 0:627ea7b55fe3 | 1 | #include "mbed.h" |
MayraPeA | 0:627ea7b55fe3 | 2 | #include "RGBLed.h" |
MayraPeA | 0:627ea7b55fe3 | 3 | RGBLed::RGBLed (PinName redpin, PinName greenpin, PinName bluepin) |
MayraPeA | 0:627ea7b55fe3 | 4 | : _redpin(redpin), _greenpin(greenpin), _bluepin(bluepin) |
MayraPeA | 0:627ea7b55fe3 | 5 | { |
MayraPeA | 0:627ea7b55fe3 | 6 | |
MayraPeA | 0:627ea7b55fe3 | 7 | _redpin.period(0.0005); |
MayraPeA | 0:627ea7b55fe3 | 8 | } |
MayraPeA | 0:627ea7b55fe3 | 9 | |
MayraPeA | 0:627ea7b55fe3 | 10 | void RGBLed::write(float red,float green, float blue) |
MayraPeA | 0:627ea7b55fe3 | 11 | { |
MayraPeA | 0:627ea7b55fe3 | 12 | _redpin = red; |
MayraPeA | 0:627ea7b55fe3 | 13 | _greenpin = green; |
MayraPeA | 0:627ea7b55fe3 | 14 | _bluepin = blue; |
MayraPeA | 0:627ea7b55fe3 | 15 | } |