Dependencies: KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180
Fork of TestBenchSerenity-proto_F429ZI1 by
Diff: main.h
- Revision:
- 7:b385e6a3f622
- Parent:
- 4:79b23d1fbcd1
diff -r f2cb21046678 -r b385e6a3f622 main.h --- a/main.h Wed Aug 02 21:08:10 2017 +0000 +++ b/main.h Thu Aug 03 19:07:43 2017 +0000 @@ -58,7 +58,7 @@ #define pumpPwmFrequency 1000 // Frequency of PWM signal supplied to pump #define pumpTachPoles 6 // 6 pulses per revolution -#define pumpTachPin PB_15 // Pump tach input (green wire) +#define pumpTachPin PA_10 // Pump tach input (green wire) #define pumpCtrlPin PB_13 // Pump control (white wire) // End Liquid pump defines @@ -66,7 +66,7 @@ Mutex i2c1_m, i2c2_m, i2c3_m, stdio_m; //DigitalOut myled(LED2); -Serial pc(USBTX, USBRX, 250000); // tx, rx, baud +Serial pc(SERIAL_TX, SERIAL_RX, 250000); // tx, rx, baud // an I2C sub-class that provides a constructed default class I2CPreInit : public I2C @@ -93,13 +93,14 @@ AnalogIn pot2(A1); PwmOut pump(pumpCtrlPin); + //pump.period(.001); PID pump_control_PID(pumpKp, pumpKi, pumpKd, pumpPIDRate); -//InterruptIn pumpTach(pumpTachPin); -volatile int pumpTachCounts = 0; -volatile float pumpRpm = 0; +InterruptIn pumpTach(pumpTachPin); +int pumpTachCounts = 0; +float pumpRpm = 0; //PwmOut ledRed(PE_11); //PwmOut ledGrn(PD_15); @@ -108,4 +109,5 @@ // Level sensor //VL6180 level(i2c1); //I2C object //float agentlevel = 0; +Ticker pump_tach_ticker, pump_pid_ticker, print_process_values_ticker, lcd_update_ticker; #endif \ No newline at end of file