tes ir atas semua
Dependencies: mbed ADS1115 StepperMotor SRF05 TPA81new
Diff: main.cpp
- Revision:
- 7:a6dc7ec6e4c0
- Parent:
- 6:69c59bcab6ea
- Child:
- 8:5e1854c119ba
--- a/main.cpp Fri Feb 09 16:55:06 2018 +0000 +++ b/main.cpp Fri Feb 09 17:23:27 2018 +0000 @@ -30,8 +30,8 @@ // Settings // Servo comm : tx, rx, txEn, id, baud TextLCD lcd(PA_5, PA_11, PA_6, PB_12, PA_7, PB_6); // LCD : rs, e, d4-d7 AnalogIn ir(PC_5); // Sharp IR : analog -DigitalOut m2(PA_15); // extinguisher : 12V out M2 -DigitalOut m1(PB_7); // extinguisher : 12V out M1, possibly broken +DigitalOut m2(PA_15); // extinguisher : 12V out M2, possibly broken +DigitalOut m1(PB_7); // extinguisher : 12V out M1 DigitalOut led1(PC_13); // GPIO high is 3V3 DigitalOut led2(PC_14); DigitalIn sound(PA_12); // Sound act : digital, active low @@ -64,8 +64,8 @@ float line1_o = 0; float line2_o = 0; float meas = 0; - int snd = 0; - int uvo = 0; + float snd = 0; + float uvo = 0; int ext = 0; // Lidar @@ -89,10 +89,10 @@ while (1) { // LCD - lcd.printf("%.1f L%.1d%.1d\n", meas, line1_o, line2_o); - pc.printf("%.2fcm L1%.2f L2%.2f ", meas, line1_o, line2_o); + lcd.printf("%.1f L%.2f|%.2f\n", meas, line1_o, line2_o); + pc.printf("%.2fcm L%.2f|%.2f ", meas, line1_o, line2_o); - lcd.printf("s%d u%d\n", snd, uvo); + lcd.printf("s%d u%d\n", (int)snd, (int)uvo); pc.printf("s%d u%d ", snd, uvo); // IR