~
Revision 2:f131a1777c54, committed 2016-09-12
- Comitter:
- kswanson31
- Date:
- Mon Sep 12 20:53:25 2016 +0000
- Parent:
- 1:cd5247f3a499
- Child:
- 4:cdcf29f5d75b
- Commit message:
- Completed RGB control. All parts included
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Sep 11 22:24:03 2016 +0000
+++ b/main.cpp Mon Sep 12 20:53:25 2016 +0000
@@ -14,7 +14,7 @@
char Opcode = 0x40; // 8-bit address for writes
MCP23S17 chip = MCP23S17(spi, p20, Opcode); // create an MCP23S17
int switch_state;
-// Analog control
+// RGB led control
AnalogIn control_pot(p18);
PwmOut rgb_b(p22);
PwmOut rgb_r(p23);
@@ -56,7 +56,7 @@
wait(.2);
// yellow led should change opposite the green led
- // Analog control
+ // RGB led control
rgb_r = control_pot;
rgb_g = 0.5f - control_pot;
rgb_b = 1.0f - control_pot;