![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Main Program
Dependencies: mbed AQM1602 HMC6352 PID
Diff: main_processing/setup_command_active/command.cpp
- Revision:
- 23:d95d8d3e89f3
- Parent:
- 22:a95f7c63af3c
- Child:
- 24:9fb74ea3c25d
--- a/main_processing/setup_command_active/command.cpp Sat Jan 30 09:27:51 2016 +0000 +++ b/main_processing/setup_command_active/command.cpp Sat Jan 30 10:08:47 2016 +0000 @@ -77,7 +77,7 @@ } uint8_t LoopFunction0(uint8_t x){ char buf[0x10]; - sprintf(buf, "CAR%d", x); + sprintf(buf, "Strategy:%2d", data.strategy); Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0; } uint8_t LoopFunction1(uint8_t x){ @@ -89,20 +89,21 @@ } uint8_t LoopFunction2(uint8_t x){ char buf[0x10]; - sprintf(buf, "RR%d", x); + ReadIr(); + + if(x==1) sprintf(buf, "SHRT:%2d, LNG:%2d", data.irSpot[0], data.irSpot[1]); + if(x==2) sprintf(buf, "NOTE:%2d", data.irNotice); Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0; } -uint8_t LoopFunction3(uint8_t x){ return 0; } +uint8_t LoopFunction3(uint8_t x){ + char buf[0x10]; + sprintf(buf, "A:%1d B:%1d C:%1d ", Line[2].read(), Line[1].read(), Line[0].read()); + Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0; +} uint8_t LoopFunction4(uint8_t x){ char buf[0x10]; - uint8_t linedata=0, line[3]; - if(x==1){ - linedata = RawLineSignal; - } - line[2] = (0x4 & linedata)>>2; - line[1] = (0x2 & linedata)>>1; - line[0] = (0x1 & linedata)>>0; - sprintf(buf, "A:%1d B:%1d C:%1d ", line[2], line[1], line[0]); + PidUpdate(); + sprintf(buf, "Cmps:%3.1f", data.InputPID); Lcd.locate(0, 1);Lcd.print(buf);wait_ms(50);return 0; } uint8_t LoopFunction5(uint8_t x){