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.
RGBLed.cpp
00001 #include "RGBLed.h" 00002 00003 RGBLed::RGBLed(PinName redPin, PinName greenPin, PinName bluePin) : m_red(redPin), m_green(greenPin), m_blue(bluePin) 00004 { 00005 } 00006 00007 void RGBLed::init() 00008 { 00009 m_red.period(0.001); 00010 } 00011 00012 void RGBLed::setColor(const float red, const float green, const float blue) 00013 { 00014 // Negative logic 00015 m_red = 1.f - red; 00016 m_green = 1.f - green; 00017 m_blue = 1.f - blue; 00018 }
Generated on Mon Aug 1 2022 05:31:13 by
