EDIT: I was thinking about why you would think I am writing in C. I realize that the code that clears LATCH1 may seem a little confusing. There is a very specific reason for this. I am not clearing the variable. I am setting the I/O low. LATCH1 turns a latching relay on and it only needs a very short single pulse to actuate. No need to use a PULSE command. I want to turn it off after its job is done because keeping current consumption to a minimum is very important.
This is also another reason behind my logic for wanting to use a secondary variable for LED1 and LATCH1. The "toggling" of LED1 and LATCH1 are done by LEDon and LEDoff, but after that I want to be able to turn LATCH1 off directly without affecting the LEDon and LEDoff variable. The higher level TOGGLE command does not allow for this.
And as for BUTTON....I just don't like it. It does not seem that much more difficult to simply write the code out one level down. That way it allows you to customize it more easily. At least that is my inexperienced opinion thus far.
Bookmarks