|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Autonomous mode does not work
Hello I am a new programmer to FRC and having problems getting Autonomous mode to work. This is the code.
Quote:
Last edited by Sunny : 15-01-2008 at 16:45. |
|
#2
|
||||
|
||||
|
Re: Autonomous mode does not work
Autonomous mode has to be enable for autonomous code to work. You need to buy this device to test autonomous code
http://andymark.biz/am-0016.html |
|
#3
|
|||
|
|||
|
Re: Autonomous mode does not work
We already made the dongle for it. And the controller says it is in autonomous mode.
|
|
#4
|
||||
|
||||
|
Re: Autonomous mode does not work
Quote:
These should be rc_dig_in_xx variables instead. |
|
#5
|
|||
|
|||
|
Re: Autonomous mode does not work
Quote:
Code:
digital_io_1 = digital_io_2 = digital_io_3 = digital_io_4 = INPUT; Code:
if (rc_dig_in01) |
|
#6
|
|||
|
|||
|
Re: Autonomous mode does not work
I changed the variables to what you said but it does not compile then. It gives this error
Quote:
|
|
#7
|
||||
|
||||
|
Re: Autonomous mode does not work
It's "rc_dig_in##" not "rc_dig_in_##" - no final underscore.
Also, why are you checking the value of pwm01? It seems like it would make more sense just to use: Code:
if(rc_dig_in01) {
pwm01 = 254;
pwm02 = 254;
} else if(rc_dig_in02) {
pwm01 = 0;
pwm02 = 254;
} else if(rc_dig_in03) {
pwm01 = 254;
pwm02 = 0;
} else {
pwm01 = 127;
pwm02 = 127;
}
|
|
#8
|
|||||
|
|||||
|
Re: Autonomous mode does not work
With the current setup you have, the PWM outputs will only change if the output is already neutral--127. You want to pull these statements out, because once you have sent a command, the outputs will no longer be neutral--no longer 127.
Also, you do need to use rc_dig_in01 for digital input 1. Let me know if you need more help. |
|
#9
|
|||
|
|||
|
Re: Autonomous mode does not work
Quote:
p.s. i work with sunny |
|
#10
|
||||
|
||||
|
Re: Autonomous mode does not work
The while() is your problem. The value of rc_dig_in01 doesn't change between one execution of the while() loop and the next, so this loop either does nothing, or runs forever and you get the red-light-of-death.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Arcade Mode (12) does NOT work | jakk | Programming | 2 | 10-07-2006 19:27 |
| Camera does not search in autonomous mode after reset | Keith Watson | Programming | 17 | 07-03-2006 00:42 |
| How does disabled mode work? | gnirts | Programming | 5 | 13-02-2006 11:47 |
| Anyone get Autonomous mode to work? | Larry Barello | Control System | 4 | 13-01-2004 15:15 |
| Chaos theory does not work!!!!! | S9ar7acu3 | General Forum | 3 | 09-02-2003 11:46 |