![]() ![]() To enter the switch case after a2 second press you have just to enter one statement t omy original proposal.I did not read your code as it gets unreadable the more functionality you want to add. One note before NEVER use goto in C++ its bad style and makes in an object oriented language to 99.9% no sense. If (digitalRead(btn) =LOW & !buttonPress)Įlse if (digitalRead(btn) = HIGH & buttonPress) ![]() const int btn = 2 ĪttachInterrupt(digitalPinToInterrupt(btn),decoder,CHANGE) It should ask again to press Push Button for 2 Seconds to enter into Setup Mode. If I press Push Button for 2 seconds in SWITCH CASE loop, Arduino is going out of the SWITCH CASE and going into MAIN LOOP() but again coming back to SWITCH CASE() loop. 7 of PROBLEM STATEMENT the code is working fine. The code for sensing parameters (Temperature, Humidity, etc.) is yet to be written.And 10K, 0.25W resistor is connected from VCC to Pin 0.1uf Capacitor is used across the Push Button for debounce considerations.Arduino serial monitor is used to demo the Screen1-Screen6 as output.The input at Pin2 is considered as interrupt so that Arduino provides service to any moment of the time.Push Button is connected to Pin2 of Arduino (ACTIVE LOW).Again if the push button is Pressed and Hold for 2 seconds in between sensing process the Arduino should enter into Setup mode.If in between above Switch Case loop Push Button is Presses and Hold for 2 seconds the Switch case loop must get terminated and theĪrduino should go back to MAIN LOOP() where it is measuring the.After Switch case 5 the loop rolls over to Switch case 0 (SCREEN1) then Switch case 1, Switch case 2, so on.Step 5 will be repeated till Switch case 5 (screen6).Now if I press the same push button and released within a moment the next Switch case 1 (screen2) should appear. ![]() Once Arduino enters into Setup mode Switch case 0 (screen1) should appear (I have used serial monitor for the same).In Setup mode there are 6 screens which will appear one after one.When a Push Button is Pressed and Hold for 2 seconds in between the Arduino should enter into Setup mode.(I have used IF loop and.A circuit is measuring various parameters (Temperature, Humidity,Įtc.) through sensors connected to it continuously. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |