A latching trigger

Hi PaulS,

Thanks for replying. Yes, my switches have resistors fitted to them, this was following the example in the Arduino book I have. Thanks for your advice, I'll change the variable state to something more meaningful! :slight_smile:
My basic idea with this was to have the variable state, and depending on the value of this variable have the motor do something. So 0 is stop, 1 is up and 2 is down. The buttons change the variable state to initiate the motor code. The reason for the state = 1 - state bit was also from the Arduino book, which was about making the buttons so you just have to press them once rather than keep them pressed to open or close the blinds, and then either the auto stop bit kicks in when the blinds are open, or the second button press returns the variable state to 0 so you can have the blinds partly open etc.
I'll be honest the encoder bit was from an example from a different book, I don't really know about it, it works so I didn't want to touch it and for it to then stop working.