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.
test_input_main.h
- Committer:
- fionalin
- Date:
- 2022-08-04
- Revision:
- 2:d9745be6c253
File content as of revision 2:d9745be6c253:
#include <mbed.h> int main(void) { BufferedSerial pc(USBTX, USBRX, 9600); while (true) { // Switch to next state char input; ssize_t len = pc.read(&input, 1); if (len > 0) { switch (input) { case '1': pc.write("u", 1); break; case '2': pc.write("d", 1); break; case '3': pc.write("c", 1); break; case '4': pc.write("i", 1); break; case '0': pc.write("s", 1); break; default: printf("[ERROR, %d] Not a command!\n", __LINE__); break; } } } return 0; }