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.
PC/PC.h@0:3333b6066adf, 2017-12-06 (annotated)
- Committer:
- aungriah
- Date:
- Wed Dec 06 21:42:54 2017 +0000
- Revision:
- 0:3333b6066adf
asfaf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aungriah | 0:3333b6066adf | 1 | #include "mbed.h" |
aungriah | 0:3333b6066adf | 2 | |
aungriah | 0:3333b6066adf | 3 | #ifndef PC_H |
aungriah | 0:3333b6066adf | 4 | #define PC_H |
aungriah | 0:3333b6066adf | 5 | |
aungriah | 0:3333b6066adf | 6 | #define COMMAND_MAX_LENGHT 300 |
aungriah | 0:3333b6066adf | 7 | |
aungriah | 0:3333b6066adf | 8 | class PC : public Serial |
aungriah | 0:3333b6066adf | 9 | { |
aungriah | 0:3333b6066adf | 10 | public: |
aungriah | 0:3333b6066adf | 11 | PC(PinName tx, PinName rx, int baud); |
aungriah | 0:3333b6066adf | 12 | void cls(); // to clear the display |
aungriah | 0:3333b6066adf | 13 | void locate(int column, int row); // to relocate the cursor |
aungriah | 0:3333b6066adf | 14 | void readcommand(void (*executer)(char*)); // to read a char from the pc to the command string |
aungriah | 0:3333b6066adf | 15 | |
aungriah | 0:3333b6066adf | 16 | char command[COMMAND_MAX_LENGHT]; |
aungriah | 0:3333b6066adf | 17 | private: |
aungriah | 0:3333b6066adf | 18 | int command_char_count; |
aungriah | 0:3333b6066adf | 19 | }; |
aungriah | 0:3333b6066adf | 20 | #endif |
aungriah | 0:3333b6066adf | 21 |