Hello competent viewers; I'm new to this Syntax stuff and have gone as far as I can as I make toooo many errors in syntax when trying to create my little sequential, hall effect monitor that triggers a countdown timer. I wont be using a lcd screen of any sort, just a coded countdown timer. project. I entered my pseudo code and provided everything variable as "Int" and described Input and Output pins where applicable. I get lost with the multi level nesting if, and, else, then commands.
If you can help, my Christmas blessing will most definitely go your way along with my retention of my sanity. I could most likely read and understand the written code, but writing from scratch is another 20 lessons aways for me.... so pay it forward if you can.
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 = Flash 1 sec. Int. //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 // 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
Any question please share and I will humble myself before your all knowing powers.