|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
Re: help with turret code
okay got more and my batteries are recharged. This might be a dumb question, but how do you create a local variable exactly for storing the state variable? I redid the state diagram and realized that the state table is much simpler than I had thought.
|
|
#3
|
|||||
|
|||||
|
Re: help with turret code
I'd use a shift register for this. Maybe a feedback node, depending on how simple the state machine logic is.
|
|
#4
|
|||
|
|||
|
Re: help with turret code
Thanks Alan! I was able to get the code to work as you say using a shift register.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HELP WITH CODE!!! :( | nick_champ_2 | Technical Discussion | 6 | 16-01-2009 01:57 |
| Help with VB code | Setsanto | Programming | 8 | 08-02-2007 16:04 |
| Help with code | b-rant | Programming | 1 | 05-04-2006 13:52 |
| Need help with code | CaseyKasem_1251 | Programming | 3 | 18-02-2006 09:39 |
| hey need some help with writing a code please help me here | magical hands | Programming | 9 | 01-01-2004 21:46 |