asdf
Dependencies: KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180
Fork of TestBenchSerenity-proto_F429ZI by
main.cpp@5:e3eff8a04b25, 2017-07-27 (annotated)
- Committer:
- iwolf32
- Date:
- Thu Jul 27 14:27:22 2017 +0000
- Revision:
- 5:e3eff8a04b25
- Parent:
- 4:79b23d1fbcd1
rev1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dmwahl | 0:67debf2ccbc2 | 1 | #include "main.h" |
dmwahl | 0:67debf2ccbc2 | 2 | |
dmwahl | 0:67debf2ccbc2 | 3 | // main() runs in its own thread in the OS |
dmwahl | 0:67debf2ccbc2 | 4 | int main() |
dmwahl | 0:67debf2ccbc2 | 5 | { |
iwolf32 | 5:e3eff8a04b25 | 6 | pc.baud(250000); |
iwolf32 | 5:e3eff8a04b25 | 7 | pc.printf("Starting up...\n\r"); |
dmwahl | 0:67debf2ccbc2 | 8 | |
iwolf32 | 5:e3eff8a04b25 | 9 | pc.printf("SN: %u Scale: %d Unit:%s\n\r", mainflow.serialNumber.u32, mainflow.scaleFactor.u16, mainflow.flowUnitStr); |
dmwahl | 0:67debf2ccbc2 | 10 | |
iwolf32 | 5:e3eff8a04b25 | 11 | while (1) { |
iwolf32 | 5:e3eff8a04b25 | 12 | mainflow.Measure(FLOW); |
iwolf32 | 5:e3eff8a04b25 | 13 | mainflow.Measure(TEMP); |
iwolf32 | 5:e3eff8a04b25 | 14 | mainflow.Measure(VDD); |
iwolf32 | 5:e3eff8a04b25 | 15 | pc.printf("%.0f %s (raw: %i) Temp: %.1fC Vdd: %.2f\n\r", ((float)mainflow.flow.i16 / mainflow.scaleFactor.u16), mainflow.flowUnitStr, mainflow.flow.i16, (float)mainflow.temperature.i16/10, (float)mainflow.vdd.u16/1000); |
iwolf32 | 5:e3eff8a04b25 | 16 | wait(2); |
dmwahl | 0:67debf2ccbc2 | 17 | } |
iwolf32 | 5:e3eff8a04b25 | 18 | } |