For anyone that may be interested, I've managed to figure this out on my own with a lot of trial and error and integrating different pices of code from the forums. I'm sure there is a more elegant solution to what I've done, but this does work, and allows for all of the functions I've described in my previous post. Here's what I've done step by step:
I'll use my defrost function as an example:
1) Defrost button changes variabe "defroststate" to "d+1" priority absolute
2) Have two separate multi-images:
a) Button down
b) Defrost logo
3) When defroststate=0, both multi-images display a transparent image on screen
4) My background has the buttons drawn on in the "up state"
5) Thus, all of the actual button images are transparent
6) In the logic section:
when defroststate between 1 and 1:
trigger the output on
change variable defroststate to 2*
7) set the multiimages to display the button down and defrost logo when defroststate=2
8) The output section has a sequence timer that turns the output on for 1000ms, then switches it off
9) I found that I had to change defroststate to 2 as in step 6, because if I didn't, defroststate would stay equal to 1 with each cycle until the button was pressed again. This meant that the output was always triggered on, and I couldn't pulse the input.
10) Now when the button is pressed again, defroststate is increased to 3
11) In the logic section:
when defroststate between 3 and 3
trigger the output on
change defroststate back to 0.
12) This sets the multi-images back to the transparent images, and essentially creates an "off" state.



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks