|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Default code and the Compressor
here is both this years default code (which doesn't work for us), and the default code from last year which does work.
|
|
#2
|
||||
|
||||
|
Re: Default code and the Compressor
Well, the code you posted should work. Strange...
Maybe you're reassigning relay8 in a different file, like user_routines_fast? Might do a search for relay8 in some other files, and see if you're setting it equal to something. |
|
#3
|
||||
|
||||
|
Re: Default code and the Compressor
We havent changed any of the other files, yet.
|
|
#4
|
||||
|
||||
|
Re: Default code and the Compressor
I diffed your 2005 code to the Default code released by FIRST and, as expected, it is identical.
This makes me believe that your compressor and/or pressure switch is wired incorrectly. Try making the following modification and see what you see Code:
relay5_rev = p1_sw_aux2;
relay6_fwd = p3_sw_aux1;
relay6_rev = p3_sw_aux2;
relay7_fwd = p4_sw_aux1;
relay7_rev = p4_sw_aux2;
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
relay8_rev = 0;
/******************/
/* THIS CODE IS ADDED */
printf("Switch %d Relay %d\r",(int)rc_digin18,(int)relay8_fwd);
/******************/
/*---------- PWM outputs Limited by Limit Switches ------------------------*/
If you see that the switch is always reading 1, then your compressor will never turn on. If that is the case, your switch may be wired incorrectly or defective. To verify this, remove the ! from the line that sets relay8_fwd. If the compressor runs and shuts off at 115 psi, then there's some weirdness on why your switch is returning an inverted value. If the compressor never shuts off, doublecheck all connections between the switch and the RC. Hopefully that helps... |
|
#5
|
||||
|
||||
|
Re: Default code and the Compressor
It DOES work with the 2004 code. but does not work with the 2005. same wiring for both. but we cant find any real diffrence between them other than the camera stuff.
|
|
#6
|
|||||
|
|||||
|
Re: Default code and the Compressor
Quote:
|
|
#7
|
||||
|
||||
|
Re: Default code and the Compressor
Matthew, et al,
I was planning to hook up a compressor this afternoon anyway. I will try the 2005 default code and report my observations. Mike |
|
#8
|
||||
|
||||
|
Re: Default code and the Compressor
Quote:
We finally got it to work. We changed this the code below and it worked. Please explain why this worked. Code:
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */ relay8_rev = 0; Code:
relay8_rev = !rc_dig_in18; /* Power pump only if pressure switch is off. */ relay8_fwd = 0; |
|
#9
|
||||
|
||||
|
Re: Default code and the Compressor
Quote:
relay8_rev must have been initialized to 1 (or set to 1) somewhere in the code or possibly it was never initialized (an uninitialized variable is, by definition, undefined). Anyway, congrats on getting it working... Mike |
|
#10
|
|||
|
|||
|
Re: Default code and the Compressor
Keep in mind that you're not supposed to run the compressor backwards - make sure that, if you have the spike in reverse, you switch the leads on the compressor or something.
|
|
#11
|
|||
|
|||
|
Re: Default code and the Compressor
yeah, mine won't work either. much more importantly, 2.4 won't even take input from our joysticks, yet 2.2 will. these are both unmodified. any suggestions?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help On Coding 2K1 Controller | GregTheGreat | Programming | 9 | 12-05-2003 06:35 PM |
| Chassis Material/Construction | sanddrag | Technical Discussion | 51 | 12-05-2003 12:59 PM |
| New software?? | mjt902 | Programming | 2 | 01-08-2003 10:40 AM |
| PBASIC 2.5 answer from Parallax | JasonS | Programming | 6 | 01-07-2003 07:21 PM |
| Team 237 unleashes a "Beast" | Elgin Clock | Robot Showcase | 5 | 03-27-2002 09:09 PM |