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 3:99a568200720, committed 2017-09-12
- Comitter:
- tvlogman
- Date:
- Tue Sep 12 15:07:38 2017 +0000
- Parent:
- 2:002f6b69ebaf
- Child:
- 4:f74c981d9bc0
- Child:
- 6:5f433011819f
- Commit message:
- Added variable keyPress which stores the character key 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:00:09 2017 +0000
+++ b/main.cpp Tue Sep 12 15:07:38 2017 +0000
@@ -1,7 +1,9 @@
#include "mbed.h"
#include "MODSERIAL.h"
-DigitalOut myled(LED_GREEN);
+DigitalOut ledG(LED_GREEN);
+DigitalOut ledR(LED_RED);
+DigitalOut ledB(LED_BLUE);
MODSERIAL pc(USBTX, USBRX);
int main()
@@ -10,9 +12,13 @@
pc.baud(115200);
pc.printf("Hello World!\r\n");
+ ledR = true;
+ ledB = true;
+
while (true) {
- pc.putc(pc.getc());
- myled = !myled; // toggle a led
+ int keyPress = pc.getc();
+ pc.putc(keyPress);
+ ledG = !ledG; // toggle a led
}
}
