|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Using Relays in Code
We ran out of speed controllers (our "genius" mechanics decided that we needed that many motors) and we are using relays and spikes right now. I am trying to use relays in the code and hitting some problems. Here is what I have now.
if(p3_sw_aux1 == 1){ relay1_fwd = 127; relay1_rev = 0; } else if(p3_sw_aux2 == 1){ relay1_fwd = 0; relay1_rev = 127; } else relay1_fwd = 254; relay1_rev = 0; the p3_sw_aux1 part appears to work and the motor doesn't move when nothing is done to it. But we are having some problems with that p3_sw_aux2 part. Any suggestions or comments would be greatly appreciated. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is your most prefered programming language? | Hailfire | Programming | 156 | 19-01-2005 21:42 |
| Interrupt timer, executing code asap? | SeanCassidy | Programming | 10 | 07-03-2004 01:47 |
| Inserting Naviagation code into Default code? | actorindp | Programming | 3 | 28-01-2004 18:12 |
| Autonomous code | PBoss | Programming | 7 | 14-01-2003 15:29 |
| Does your team use the Default code. | Jeff McCune | General Forum | 2 | 09-01-2003 14:46 |