Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Pneumatics coding (http://www.chiefdelphi.com/forums/showthread.php?t=63837)

hipsterjr 13-02-2008 22:45

Re: Pneumatics coding
 
Quote:

Originally Posted by Mark McLeod (Post 698477)
Something such as:
Code:

  static char toggle=1;

  if(p4_sw_trig && toggle)
  {
        toggle = 0;
          relay2_fwd = !relay2_fwd;
          relay2_rev = 0;
  }
  if(!p4_sw_trig)
  {
        toggle = 1;
  }

prevents further toggling until the button has been released again.

Thank you!!!:yikes:

Inetta 13-02-2008 23:17

Re: Pneumatics coding
 
Well, I downloaded my file to the rc and tried testing the triggers and the pneumatics did not even budge one bit. I have this block of code for each of the valves to be activated/deactivated

relay#_fwd = 0;
relay#_rev = 0;

if(p#_sw_x == 1)
{
relay#_fwd=1;
}
else if (p#_sw_x == 0)
{
relay#_fwd=0;
}

I did not keep in mind my compressor however, and am not sure on how to go about coding the compressor to make it turn off automatically when the pressure switch reaches a certain value.

As for the pneumatics could I have named the trigger buttons incorrectly?
I used p#_sw_x == 1 such that # = 2 or 4 and x = either trig, aux1, or aux2 in the if and else if's for the joystick inputs.


I also read somewhere that you have to
Quote:

use the OI Digital input block to get the reading off the joystick. Then you can assign the button to an unsigned char variable
How exactly do I go about doing that?


:confused: HELP!!!

Mark McLeod 14-02-2008 10:35

Re: Pneumatics coding
 
Quote:

Originally Posted by Inetta (Post 698541)
:confused: HELP!!!

What are you using to program your robot?
1) MPLAB IFI default code
2) MPLAB Kevin Watson default code
3) EasyC Pro / WPILIB
4) RobotC

The answer differs

Inetta 14-02-2008 17:09

Re: Pneumatics coding
 
Quote:

Originally Posted by Mark McLeod (Post 698758)
What are you using to program your robot?
1) MPLAB IFI default code
2) MPLAB Kevin Watson default code
3) EasyC Pro
4) RobotC

The answer differs

oh I'm sorry, MPLAB IFI Default Code

Inetta 14-02-2008 20:47

Re: Pneumatics coding
 
with severe troubleshooting and an all nighter, I got it to work! :D!! I am sooooo happy ^_^ I squealed like girls usually do when the arm moved aha :P Thanks so much for all the help, and good luck to everyone else who has had problems with their programming <3!


All times are GMT -5. The time now is 19:07.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi