Hello all, I'm not sure where to post this , but I'm seeking assistance with generating an event
countdown timer (syntax only, no digital lcd involved) based on my attached Pseudo Code below. If anybody here can assist let me know or point me to where I should go to find someone to write the code for it.
Until then, Hello World... LOL... yes I'm new to this coding and this nesting if's drives me crazy.
Be well
Gil
Int HESAPin = 3; // sets pin 3 as Hall Effect Sensor A
Int HESALedPin = 5; // sets pin 5 as Hall Effect Sensor A Led
Int HESBPin = 7; // sets pin 7 as Hall Effect Sensor B
Int HESBLedPin = 9; // sets pin 9 as Hall Effect Sensor B Led
Int SolenoidPin = 11; //sets pin 11 as Solenoid
Int SolenoidLed = 13; //sets pin 13 as Solenoid Led
Int CountDownTimer = 180000 //defines countdown timer to 3 minutes
Int AccessCountDownTimer = 3000000 //defines access countdown timer to 5 minutes
Int SolenoidDelayHigh = 10000 //defines ON solenoid time to 10 sec. when triggered
Int SolenoidDelayLow = 50000 //defines OFF solenoid time to 50 sec. when triggered
Int HESAHigh = >= 1500, <=2500 // A duration approximating a 2 second time period
Int HESALow = >= 1500, <=2500 // A duration approximating a 2 second time period
Setup loop ()
PinMode HESAPin = INPUT; //defines pin 3 to Input HESA
PinMode HESBLedPin = OUTPUT; //defines pin 5 to output HESALed
PinMode HESBPin = INPUT; //defines pin 7 to Input HESB
PinMode HESBLedPin = OUTPUT; //defines pin 9 to output HESBLed
PinMode SolenoidPin = OUTPUT; //defines pin 11 to output Solenoid
PinMode SolenoidLed = OUTPUT; //defines pin 13 to output Solenoid
If (Normal operating mode)
• If HESBPin, HIGH //if and while hall effect sensor B active
• Decrement CountDownTimer //Countdown counts down to zero
• CountDownTimer >=0 //Countdown timer not expired, repeat
• HESBLedPin = Flashing 1 second intervals //HESBLed flashing on/off while HESBPin active
Else (Triggered Mode)
• SolenoidPin = HIGH //if countdown timer expires, 5 volt to SolenoidPin
• HESBLedPin = HIGH // HESBLedPin HIGH, for duration of this cycle or until reset
• SolenoidLed =HIGH //SolenoidLed High along with SolenoidPin
• SolenoidDelayHigh // SolenoidDelayHigh duration
• SolenoidPin = LOW // SolenoidPin off
• SolenoidLed = LOW //SolenoidLed Low along with SolenoidPin
• SolenoidDelayLow // SolenoidDelayLow duration
If – Then (Reset Mode)
• If HESAPin, HESAHigh //If HESAPin HIGH for approximately 2’s
• HESALedLed = HIGH //HESALed HIGH while HESAPin HIGH as above
• If HESAPin, HESALow //If HESAPin LOW for approximately 2’s
• HESALedPin = LOW //HESALed LOW while HESAPin LOW as above
• If HESAPin, HESAHigh //If HESAPin HIGH for approximately 2’s
• HESALedPin = HIGH //HESALed HIGH while HESAPin HIGH as above
• If HESAPin, HESALow //If HESAPin LOW for approximately 2’s
• HESALedPin = LOW //HESALed LOW while HESAPin LOW as above
• If HESAPin, HESAHigh //If HESAPin HIGH for approximately 2’s
• HESALedPin = HIGH //HESALed HIGH while HESAPin HIGH as above
• Return to normal operating mode // Resets all and returns to Normal operating mode