![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
This is how i got the hardware to work. Not saying that it cant work any other way. I haven't tied anything of yours in. So likely delete mine from rev 2 or 3, and then put this instead. Then it might work.
Dependencies: mbed
rgb_led.h@0:c426396d5fdf, 2017-06-22 (annotated)
- Committer:
- PET
- Date:
- Thu Jun 22 04:45:01 2017 +0000
- Revision:
- 0:c426396d5fdf
If you wanted to work on it, or look at it.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
PET | 0:c426396d5fdf | 1 | /* |
PET | 0:c426396d5fdf | 2 | -------------------------------------------------------------------------------- |
PET | 0:c426396d5fdf | 3 | -- Project: PRO2 "Awareness and Optimisation of energy consumption" |
PET | 0:c426396d5fdf | 4 | -- Team: Team 1 |
PET | 0:c426396d5fdf | 5 | |
PET | 0:c426396d5fdf | 6 | -- File Name: rgb_led.h |
PET | 0:c426396d5fdf | 7 | -- Author: Poul Erik Tjørnfelt |
PET | 0:c426396d5fdf | 8 | -- Date: 07/05-2017 |
PET | 0:c426396d5fdf | 9 | -- Copyright: Open to all |
PET | 0:c426396d5fdf | 10 | -- Version: 0.6 - Creation of file. |
PET | 0:c426396d5fdf | 11 | -- 1.0 - File approval. |
PET | 0:c426396d5fdf | 12 | -- |
PET | 0:c426396d5fdf | 13 | -- Description: The header file for a class, that creates instances of |
PET | 0:c426396d5fdf | 14 | -- the actual RGB lamp that is used. |
PET | 0:c426396d5fdf | 15 | -- |
PET | 0:c426396d5fdf | 16 | -------------------------------------------------------------------------------- |
PET | 0:c426396d5fdf | 17 | */ |
PET | 0:c426396d5fdf | 18 | |
PET | 0:c426396d5fdf | 19 | #ifndef RGB_LED_H |
PET | 0:c426396d5fdf | 20 | #define RGB_LED_H |
PET | 0:c426396d5fdf | 21 | #include "mbed.h" |
PET | 0:c426396d5fdf | 22 | |
PET | 0:c426396d5fdf | 23 | class RGB_LED |
PET | 0:c426396d5fdf | 24 | { |
PET | 0:c426396d5fdf | 25 | public: |
PET | 0:c426396d5fdf | 26 | RGB_LED(PinName pin_R, PinName pin_G, PinName pin_B); |
PET | 0:c426396d5fdf | 27 | void set(float red, float green, float blue); |
PET | 0:c426396d5fdf | 28 | void flash(float per_r, float time_r, float per_g, float time_g, |
PET | 0:c426396d5fdf | 29 | float per_b, float time_b); |
PET | 0:c426396d5fdf | 30 | |
PET | 0:c426396d5fdf | 31 | private: |
PET | 0:c426396d5fdf | 32 | PwmOut pin_r; |
PET | 0:c426396d5fdf | 33 | PwmOut pin_g; |
PET | 0:c426396d5fdf | 34 | PwmOut pin_b; |
PET | 0:c426396d5fdf | 35 | }; |
PET | 0:c426396d5fdf | 36 | |
PET | 0:c426396d5fdf | 37 | #endif |