Go Down

Topic: else loop ignored anywhere (Read 1 time) previous topic - next topic


thanks Folks.

Apologies for shortcutting the tutorials: as you may have realized, I am not an addicted to Arduino, reason why am trying to programme it is because I need to manage some non-on/off logics in my house utilities.

Should I need furher assistance on the code,I'll follow instructions to export it as compilable code.

Bottom line so far: I can use 0 and 1 only if not connected to serial port, so I need to use another 2 pins to test the code and when it works reallocate to 1 and 2 before putting in operation.

Second, I can't leave a conditional open, otherwise the cose would not just go to next line and do nothing, but would do random assignment, correct?


Thanks Folks, the FULL CODE works now!!!

My lesson learnt from a general perspective and for the beginners like me:

1. Start with HARDWARE: Need to really understand what each pin can/cannot do and in which possible combination. I was messing up my full sketch just because had put an input to a simple IFTE statement running on a TX/RX pin!

2. Use this forum: it is fu...g powerful and has many passionate people able to support. And spend 10 mins reading TUTORIAL as this will save you time in effective communication

3. Whatever variable or output you activate in a loop and don't want to find in the same status when the loop counter reaches the cap and loop starts over, make sure you write command lines to RESET those to their loop begin values: I had loop restarting and alarm output staying on with no alarm condition, just because I forgot to write a line to reset it at end of loop

4. CAREFUL using the right variables. If you are reading sub-decimal values, and use the int type, whatever combination of formulas using those variables will result in ZERO. Use Float instead!

Thanks to all for supporting!

Go Up