![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
tbi fiat com controle feedforward PID
Dependencies: mbed reScale TextLCD
Diff: main.cpp
- Revision:
- 4:9da4a46f38bc
- Parent:
- 3:9d22aa32b223
- Child:
- 5:e04419b1e369
diff -r 9d22aa32b223 -r 9da4a46f38bc main.cpp --- a/main.cpp Wed Apr 25 12:10:09 2018 +0000 +++ b/main.cpp Thu Apr 26 18:54:15 2018 +0000 @@ -1,5 +1,8 @@ #include "mbed.h" - +#include "TextLCD.h" + +I2C i2c_lcd(PTC9,PTC8); // SDA, SCL + InterruptIn motora(D0); InterruptIn movida(D1); @@ -14,6 +17,8 @@ unsigned long int t_motora, t_movida, delta; +TextLCD_I2C lcd(&i2c_lcd, 0x7E, TextLCD::LCD16x2); // I2C exp: I2C bus, PCF8574 Slaveaddress, LCD Type + void tracao() { tbase.stop(); @@ -40,8 +45,16 @@ motora.fall(&tracao); // attach the address of the measure function to the rising edge movida.fall(&livre); // attach the address of the measure function to the rising edge - - //call.attach(&send, 0.5); + + lcd.setBacklight(TextLCD::LightOn); + lcd.setCursor(TextLCD::CurOff_BlkOff); + lcd.setAddress(0,0); + lcd.printf("Controle de"); + lcd.setAddress(0,1); + lcd.printf("TRACAO"); + wait(1.5); + lcd.cls(); + while(1) { @@ -53,11 +66,15 @@ { ign=0; wait(0.1); + lcd.setAddress(0,0); + lcd.printf("Destracionando"); } else { ign=1; + lcd.setAddress(0,0); + lcd.printf("Normal "); } } } \ No newline at end of file