Could someone please help me with this?
This is all happening in a loop, so Input1 is always being called. When Input1 switches to True I would like Output1 to turn on, and then off, like a light switch, so for an ms. This on, then off I would like to only happen once while the Input1 is still being called. So later on if Input1 goes back to False and then True after that, it wont affect Output1 which has had its 'switch' - (on then off), happen once already. I hope that helps?
#Input1 is a boolean
on = True
off = False
if Input1 == True:
Output1 = on
#Only turn on for one moment
#then turn off right away even while Input1 continues to be True
else:
Output1 = off
I thought I could do something like this:
#Input1 is a boolean
on = True
off = False
count = 0
if Input1 == True and count == 0:
Output1 = on
count = 1
else:
Output1 = off