|
Re: help with turret code
your state machine approach is correct, though i dont exactly know what you hope to accomplish with the shift registers... youd hope that part of the code would be in the "main loop".
id just store the state in a local variable. The only reason i can think of for the states "flickering" back and forth is you have inverse logic on the switches; your transition condition is satisfied immediately (true on release, false on press). its kinda hard to diagnose exactly without a vi and how its called.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
|