![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
chad
Dependencies: MCP23017 WattBob_TextLCD mbed-rtos mbed
Diff: main.cpp
- Revision:
- 15:85616bc0e2ae
- Parent:
- 14:ede0e7ed2745
- Child:
- 16:bebcc7d24f3e
--- a/main.cpp Wed Mar 08 15:36:57 2017 +0000 +++ b/main.cpp Wed Mar 08 16:17:09 2017 +0000 @@ -32,8 +32,8 @@ // Timer objects //Ticker tick; // Clock timer for CycExec Ticker ticker; -//Timer timer; // Frequency Timer -//Timer T5; // Timer for idle states +Timer timer; // Frequency Timer +Timer T5; // Timer for idle states // Constant Declaration const int SampFreq = 100; // Sampling Frequency @@ -42,20 +42,20 @@ // Variable Declaration int tck = 1; // Used to define what task is called (CycExec) -int FqIn = Fq; // Frequency input boolean +int FqIn; // Frequency input boolean int period = 0; // Frequency timer variable (Frequency Check) int freq = 0; // Frequency return variable (Frequency Check) -int DSIn = DS; // Switch Input boolean +int DSIn; // Switch Input boolean int switch_state = 0; -int WD_pulse; +int WD_pulse = 0; -int A1_in = A1_; // Analogue 1 input variable -int A2_in = A2_; // Analogue 2 input variable -int A1_val = 0; // Analogue 1 return variable (Analogue In) -int A2_val = 0; // Analogue 2 return variable (Analogue In) +float A1_in; // Analogue 1 input variable +float A2_in; // Analogue 2 input variable +float A1_val = 0; // Analogue 1 return variable (Analogue In) +float A2_val = 0; // Analogue 2 return variable (Analogue In) int DS_sIn = DS_s; // Shutdown Switch int error_code = 0; // Error code variable @@ -99,13 +99,24 @@ Task8(); } */ + Task4(); //lcd->locate(0,0); //lcd->printf("Tck: %d", tck); led2 = !led2; + FqIn = Fq; + DSIn = DS; + A1_in = A1_; + A2_in = A2_; + DS_sIn = DS_s; + WD_pulse_out = WD_pulse; + + /*lcd->locate(0,0); + lcd->printf("S: %d", switch_state);*/ + tck++; - //WD_pulse_out = WD_pulse; + } @@ -136,7 +147,7 @@ while(1){ led1 = !led1; - wait(0.2); + wait(0.2); } }