![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Teclado para control PID
Dependencies: Debounced FPointer TextLCD11 keypad mbed
Diff: main.cpp
- Revision:
- 1:f578cd888e48
- Parent:
- 0:17aecb7bba09
- Child:
- 2:da30c4b60cf4
diff -r 17aecb7bba09 -r f578cd888e48 main.cpp --- a/main.cpp Wed Dec 04 19:29:51 2013 +0000 +++ b/main.cpp Wed Dec 04 20:28:01 2013 +0000 @@ -121,39 +121,100 @@ if (c==0){ - lcd.locate(3,0); lcd.putc(0xFE); lcd.locate(4,0); - lcd.printf("%d",sp); + lcd.printf("%d",sp); + + //NEW !! (not zeros in -- process) + if(sp<10){ + lcd.locate(5,0); + lcd.putc(0xFE); + } + + if(sp<100){ + lcd.locate(6,0); + lcd.putc(0xFE); + } + + lcd.locate(4,0); + lcd.printf("%d", sp); + //wait(0.1); + // + } if (c==1){ - lcd.locate(11,0); lcd.putc(0xFE); lcd.locate(12,0); lcd.printf("%d",kp); + //NEW !! (not zeros in -- process) + if(kp<10){ + lcd.locate(13,0); + lcd.putc(0xFE); + } + + if(sp<100){ + lcd.locate(14,0); + lcd.putc(0xFE); + } + + lcd.locate(12,0); + lcd.printf("%d", kp); + //wait(0.1); + + // + } - if (c==2) { - + if (c==2) { lcd.locate(3,1); lcd.putc(0xFE); lcd.locate(4,1); - lcd.printf("%d",ki); - + lcd.printf("%d",ki); + + //NEW !! (not zeros in -- process) + if(ki<10){ + lcd.locate(5,1); + lcd.putc(0xFE); + } + + if(ki<100){ + lcd.locate(6,1); + lcd.putc(0xFE); + } + + lcd.locate(4,1); + lcd.printf("%d", ki); + //wait(0.2); + + // + } - if (c==3) { - + if (c==3) { lcd.locate(11,1); lcd.putc(0xFE); lcd.locate(12,1); lcd.printf("%d",kd); - } + //NEW !! (not zeros in -- process) + if(kd<10){ + lcd.locate(13,1); + lcd.putc(0xFE); + } + + if(kd<100){ + lcd.locate(14,1); + lcd.putc(0xFE); + } + + lcd.locate(12,1); + lcd.printf("%d", kd); + //wait(0.2); + } if(c==4 || c>4){ c=0;