You can write text with this programm.
Fork of Minor_test_serial by
main.cpp
- Committer:
- JanderGilbers
- Date:
- 2016-09-12
- Revision:
- 2:4ffe049e7231
- Parent:
- 1:26ce7013f2c5
File content as of revision 2:4ffe049e7231:
#include "mbed.h" #include "MODSERIAL.h" DigitalOut grled(LED_GREEN); DigitalOut rdled(LED_RED); DigitalOut blled(LED_BLUE); MODSERIAL pc(USBTX, USBRX); char c; int Ticker; void ticking(bool& a) { a = !a; } int main() { int i = 0; pc.baud(115200); pc.printf("Hello World!\n"); while(true){ { c = pc.getc(); pc.printf("%c", c); // print the value of variable i switch (c) { case 'r' : rdled = false; grled = true; blled = true; break; case 'b' : rdled = true; grled = true; blled = false; break; case 'g' : rdled = true; grled = false; blled = true; break; } wait(0.1f); } } }