Main Code
Dependencies: DRV8833 PidControllerV3 mbed Buffer
Fork of ApexPID by
RGB_LED/RGB_LED.cpp@0:95384d72794f, 2018-05-07 (annotated)
- Committer:
- batchee7
- Date:
- Mon May 07 05:20:37 2018 +0000
- Revision:
- 0:95384d72794f
IntialRelease
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
batchee7 | 0:95384d72794f | 1 | #include "mbed.h" |
batchee7 | 0:95384d72794f | 2 | #include "RGB_LED.h" |
batchee7 | 0:95384d72794f | 3 | |
batchee7 | 0:95384d72794f | 4 | RGB_LED::RGB_LED(PinName RedPin, PinName GreenPin, PinName BluePin):_Rpin(RedPin), |
batchee7 | 0:95384d72794f | 5 | _Gpin(GreenPin), _Bpin(BluePin) |
batchee7 | 0:95384d72794f | 6 | { |
batchee7 | 0:95384d72794f | 7 | _Rpin = false; |
batchee7 | 0:95384d72794f | 8 | _Gpin = false; |
batchee7 | 0:95384d72794f | 9 | _Bpin = false; |
batchee7 | 0:95384d72794f | 10 | } |
batchee7 | 0:95384d72794f | 11 | |
batchee7 | 0:95384d72794f | 12 | void RGB_LED::Red() |
batchee7 | 0:95384d72794f | 13 | { |
batchee7 | 0:95384d72794f | 14 | _Rpin = true; |
batchee7 | 0:95384d72794f | 15 | _Gpin = false; |
batchee7 | 0:95384d72794f | 16 | _Bpin = false; |
batchee7 | 0:95384d72794f | 17 | return; |
batchee7 | 0:95384d72794f | 18 | } |
batchee7 | 0:95384d72794f | 19 | |
batchee7 | 0:95384d72794f | 20 | void RGB_LED::Green() |
batchee7 | 0:95384d72794f | 21 | { |
batchee7 | 0:95384d72794f | 22 | _Rpin = false; |
batchee7 | 0:95384d72794f | 23 | _Gpin = true; |
batchee7 | 0:95384d72794f | 24 | _Bpin = false; |
batchee7 | 0:95384d72794f | 25 | return; |
batchee7 | 0:95384d72794f | 26 | } |
batchee7 | 0:95384d72794f | 27 | |
batchee7 | 0:95384d72794f | 28 | void RGB_LED::Blue() |
batchee7 | 0:95384d72794f | 29 | { |
batchee7 | 0:95384d72794f | 30 | _Rpin = false; |
batchee7 | 0:95384d72794f | 31 | _Gpin = false; |
batchee7 | 0:95384d72794f | 32 | _Bpin = true; |
batchee7 | 0:95384d72794f | 33 | return; |
batchee7 | 0:95384d72794f | 34 | } |
batchee7 | 0:95384d72794f | 35 | |
batchee7 | 0:95384d72794f | 36 | void RGB_LED::Off() |
batchee7 | 0:95384d72794f | 37 | { |
batchee7 | 0:95384d72794f | 38 | _Rpin = false; |
batchee7 | 0:95384d72794f | 39 | _Gpin = false; |
batchee7 | 0:95384d72794f | 40 | _Bpin = false; |
batchee7 | 0:95384d72794f | 41 | return; |
batchee7 | 0:95384d72794f | 42 | } |