This code will read from both heaters every 2 seconds
Dependencies: mbed Watchdog Heater MODSERIAL FastPWM ADS8568_ADC
Revision 1:dffc1d53435d, committed 2019-08-06
- Comitter:
- omatthews
- Date:
- Tue Aug 06 14:14:02 2019 +0000
- Parent:
- 0:aaad1791753c
- Commit message:
- Updated to change log file
Changed in this revision
Heater.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Heater.lib Tue Aug 06 12:46:14 2019 +0000 +++ b/Heater.lib Tue Aug 06 14:14:02 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/The-Technology-Partnership/code/Heater/#e2a504521b46 +https://os.mbed.com/teams/The-Technology-Partnership/code/Heater/#085b53e06065
--- a/main.cpp Tue Aug 06 12:46:14 2019 +0000 +++ b/main.cpp Tue Aug 06 14:14:02 2019 +0000 @@ -15,7 +15,7 @@ ------------------------------------------------------------------------------*/ #define ALL_CH 15 //value of convst bus to read all chanels simultaneosly - +#define MEASUREMENT_WAIT 5 //The wait time between reads in seconds Watchdog wd; //instantiate watchdog class @@ -102,18 +102,16 @@ guard_1.period_us(PWM_PERIOD); guard_2.period_us(PWM_PERIOD); - //while(user_1 == 0); - - //Body + + pc.printf("Number of reads, Time (ms), Current 1, Voltage 1, Resistance 1, Current 2, Voltage 2, Resistance 2"); - //if (wd.WatchdogCausedReset()) - // pc.printf("Watchdog caused reset.\r\n"); - + while(1){ heater_1.read(); heater_2.read(); - wait(2); + pc.printf("%d,%d,%d,%d,%f,%d,%d,%f\n",log_count,timer.read_ms(),heater_1.Get_i(),heater_1.Get_v(),heater_1.Get_R(),heater_2.Get_i(),heater_2.Get_v(),heater_2.Get_R()); + wait(MEASUREMENT_WAIT); }