Non-blocking delay with X10 commands

rossw said:
Can you tell me what the bits indicated in green are for??
 
The way the original code was submitted, you couldn't actually reach the "turnon" routine unless it had done an off-to-on transition and stayed on for at least 5 mins (or whatever), so the extra code to make sure it hadn't sent the email (tsteq ram1 0) is unnecessary, as is setting ram1 (because you turn op1 off, so it will not execute the same code again until it has had another transition), which renders the "turnoff" clearing of ram1 unnecessary too!
Without setting RAM1 or VAR1 1 after sending an email the board keeps on sending emails (more or less one every two seconds) as long as IP5 is high.
(I'm using a VAR now because I can check this through the GUI)
If IP5 stays high after 5min the board sends another mail but this is ok.
 
laodice said:
 as long as IP5 is high.
 
OK, that's the missing bit. I thought you'd said the input was from a pushbutton or similar, and that it wouldn't be on for much more than a brief pulse.
In that particular case, I'd prefer to do a simple edge-detection on the input, rather than interlocking flags. It solves the problem at the point of origin, rather than kludging it with additional complexity afterwards.
 
rossw said:
OK, that's the missing bit. I thought you'd said the input was from a pushbutton or similar, and that it wouldn't be on for much more than a brief pulse.
In that particular case, I'd prefer to do a simple edge-detection on the input, rather than interlocking flags. It solves the problem at the point of origin, rather than kludging it with additional complexity afterwards.
Does WC8 also have this feature?
I can't find it in the manual.
 
It does not detect phase change in TTL input. However, you could use IPx[y] and IPIVx[y] to detect the pulse is which direction going, since negative going pulse will immediately go through IPx[y] to change it to zero, and IPINVx[y] will do opposite. Experiment with them with different pulses, they can be useful in your situation.
 
Back
Top