
Project Template for Headstart Course 2017
Dependencies: N5110 ShiftReg Tone mbed
Fork of 1620_Project_Template by
Revision 4:4269457cf8d8, committed 2017-07-12
- Comitter:
- eendmo
- Date:
- Wed Jul 12 16:15:04 2017 +0000
- Parent:
- 3:625925922d09
- Commit message:
- Updated Mode B
Changed in this revision
ModeA/ModeA.cpp | Show annotated file Show diff for this revision Revisions of this file |
ModeB/ModeB.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ModeA/ModeA.cpp Mon Jul 10 14:28:29 2017 +0000 +++ b/ModeA/ModeA.cpp Wed Jul 12 16:15:04 2017 +0000 @@ -26,7 +26,6 @@ } - sevenSeg.write(segments[count]); }
--- a/ModeB/ModeB.cpp Mon Jul 10 14:28:29 2017 +0000 +++ b/ModeB/ModeB.cpp Wed Jul 12 16:15:04 2017 +0000 @@ -18,7 +18,10 @@ //All code goes in here! - + + + + update_display(); @@ -30,13 +33,9 @@ void update_display(){ - int red_percent = 100.0 - (red_led/1.0) * 100.0; - int blue_percent = 100.0 - (blue_led/1.0) * 100.0; - int green_percent = 100.0 -(green_led/1.0) * 100.0; - - voltage_a = pot_0.read() * 3.3; - voltage_b = pot_1.read() * 3.3; - voltage_c = pot_2.read() * 3.3; + int red_percent = (voltage_a/3.3) * 100.0; + int green_percent = (voltage_b/3.3) * 100.0; + int blue_percent = (voltage_c/3.3) * 100.0; char new_string[3]; lcd.printString("R G B ",0,2);