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: C12832 LM75B mbed EthernetInterface mbed-rtos
rgb.h
00001 #pragma once 00002 00003 #include "mbed.h" 00004 #include <string> 00005 00006 #define MAX_ARRAY_LENGTH_RGB 7 00007 00008 namespace ProjectOne{ 00009 00010 class RGB{ 00011 public: 00012 /* 00013 * Constructor for RGB class. 00014 * 00015 @param The pins that are connected to the RGB on the application board. 00016 @return Nothing. 00017 */ 00018 RGB(PinName firstPin=p23, PinName secondPin=p24, PinName thirdPin=p25); 00019 00020 /* 00021 * Method turns on the LED according to the given color. 00022 * 00023 @param A string containing the color to be displayed. 00024 @return Nothing. 00025 */ 00026 void turnOnLed(string kleur); 00027 private: 00028 const static float r_values[MAX_ARRAY_LENGTH_RGB]; 00029 const static float g_values[MAX_ARRAY_LENGTH_RGB]; 00030 const static float b_values[MAX_ARRAY_LENGTH_RGB]; 00031 PwmOut r; 00032 PwmOut g; 00033 PwmOut b; 00034 int determineRgbIndex(string kleur); 00035 }; 00036 };
Generated on Sat Jul 23 2022 22:59:36 by
1.7.2