Skeleton code. LCD, Serial, Feedback, MOSFETS
Dependencies: mbed mbed-rtos ShiftReg2 TextLCD
Serial/Serial_PC.cpp@4:020f93d35f6e, 2019-05-07 (annotated)
- Committer:
- thomasmorris
- Date:
- Tue May 07 21:55:57 2019 +0000
- Revision:
- 4:020f93d35f6e
Added mutex and safey coding needs more. Added board and serial functions that need testing. As well as a more thorough post function.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thomasmorris | 4:020f93d35f6e | 1 | #include "Serial_PC.hpp" |
thomasmorris | 4:020f93d35f6e | 2 | int Logging = 0; |
thomasmorris | 4:020f93d35f6e | 3 | SERIAL_PC::SERIAL_PC(){} |
thomasmorris | 4:020f93d35f6e | 4 | SERIAL_PC::~SERIAL_PC(){} |
thomasmorris | 4:020f93d35f6e | 5 | void SERIAL_PC::Init(){} |
thomasmorris | 4:020f93d35f6e | 6 | int SERIAL_PC::Post() |
thomasmorris | 4:020f93d35f6e | 7 | { |
thomasmorris | 4:020f93d35f6e | 8 | return 1; |
thomasmorris | 4:020f93d35f6e | 9 | } |
thomasmorris | 4:020f93d35f6e | 10 | void SERIAL_PC::Main() |
thomasmorris | 4:020f93d35f6e | 11 | { |
thomasmorris | 4:020f93d35f6e | 12 | while(1) |
thomasmorris | 4:020f93d35f6e | 13 | { |
thomasmorris | 4:020f93d35f6e | 14 | if(PC.readable())//Check that you can write to the PC |
thomasmorris | 4:020f93d35f6e | 15 | { |
thomasmorris | 4:020f93d35f6e | 16 | PC.printf("Testing for serial\n"); |
thomasmorris | 4:020f93d35f6e | 17 | } |
thomasmorris | 4:020f93d35f6e | 18 | PC.scanf("%s",&_buffer); |
thomasmorris | 4:020f93d35f6e | 19 | if(_buffer == "Log") |
thomasmorris | 4:020f93d35f6e | 20 | { |
thomasmorris | 4:020f93d35f6e | 21 | PC.printf("Logging\n"); |
thomasmorris | 4:020f93d35f6e | 22 | Logging = 1; |
thomasmorris | 4:020f93d35f6e | 23 | } |
thomasmorris | 4:020f93d35f6e | 24 | Thread::wait(1000); |
thomasmorris | 4:020f93d35f6e | 25 | } |
thomasmorris | 4:020f93d35f6e | 26 | } |