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: FastPWM HIDScope MODSERIAL QEI Matrix biquadFilter controller errorFetch mbed motorConfig refGen MatrixMath inverseKinematics
Fork of Minor_test_serial by
Revision 4:f74c981d9bc0, committed 2017-09-12
- Comitter:
- tvlogman
- Date:
- Tue Sep 12 15:15:24 2017 +0000
- Parent:
- 3:99a568200720
- Child:
- 5:d396168a1b20
- Commit message:
- Added functionality to turn on various color LEDs when corresponding keys are pressed.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Sep 12 15:07:38 2017 +0000
+++ b/main.cpp Tue Sep 12 15:15:24 2017 +0000
@@ -14,11 +14,37 @@
ledR = true;
ledB = true;
+ ledG = true;
while (true) {
int keyPress = pc.getc();
pc.putc(keyPress);
- ledG = !ledG; // toggle a led
+ pc.printf("%i", keyPress);
+
+ if(keyPress == 114)
+ {
+ ledG = true;
+ ledB = true;
+ ledR = !ledR;
+ }
+ else if(keyPress == 103)
+ {
+ ledR = true;
+ ledB = true;
+ ledG = !ledG;
+ }
+ else if(keyPress == 98)
+ {
+ ledR = true;
+ ledG = true;
+ ledB = !ledB;
+ }
+ else
+ {
+ ledG = true;
+ ledB = true;
+ ledR = true;
+ }
}
}
