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.
Dependents: 4180-lab3-RTOS 4180-FinalProject
Revision 1:0008e30a2bda, committed 2016-10-10
- Comitter:
- kswanson31
- Date:
- Mon Oct 10 01:56:26 2016 +0000
- Parent:
- 0:7a3ee33c0a53
- Commit message:
- Moved operator overload to class definition
Changed in this revision
| SimpleRGB.cpp | Show annotated file Show diff for this revision Revisions of this file |
| SimpleRGB.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7a3ee33c0a53 -r 0008e30a2bda SimpleRGB.cpp
--- a/SimpleRGB.cpp Mon Oct 10 00:32:31 2016 +0000
+++ b/SimpleRGB.cpp Mon Oct 10 01:56:26 2016 +0000
@@ -27,10 +27,4 @@
_rpin = color.red;
_gpin = color.green;
_bpin = color.blue;
-}
-
-// alow assingment of LightColor object to the RGBLed object
-RGBLed operator = (LightColor color) {
- write(color);
- return *this;
}
\ No newline at end of file
diff -r 7a3ee33c0a53 -r 0008e30a2bda SimpleRGB.h
--- a/SimpleRGB.h Mon Oct 10 00:32:31 2016 +0000
+++ b/SimpleRGB.h Mon Oct 10 01:56:26 2016 +0000
@@ -18,6 +18,10 @@
RGBLed(PinName rpin, PinName gpin, PinName bpin);
void write(float red, float green, float blue);
void write(LightColor color);
+ RGBLed operator = (LightColor color) {
+ write(color);
+ return *this;
+ };
private:
PwmOut _rpin;