![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
PROJ515-MASTER-No-PWM
Dependencies: mbed mbed-rtos ShiftReg2 TextLCD
Serial/Serial_PC.cpp@5:dbb984e01ded, 2019-05-08 (annotated)
- Committer:
- thomasmorris
- Date:
- Wed May 08 09:39:42 2019 +0000
- Revision:
- 5:dbb984e01ded
- Parent:
- 4:020f93d35f6e
Working code not PWM;
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 | } |