Go to Post At first blush, people don't need to know about GP any more than they need to know gear ratios, screw classifications, or LabVIEW. It's about Inspiration. It's about Recognition. It's about Science and Technology. That's all it's For; any more than that is just gravy. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2007, 08:25
Asheron Asheron is offline
Registered User
no team
 
Join Date: Jan 2007
Location: New Orleans
Posts: 13
Asheron is an unknown quantity at this point
HELP!

I'm new to FRC, new to my team, just getting started with the program and have no idea where to begin so that we might be able to program a robot in 2 weeks (2 robots actually because I'm helping two teams).

I have not used EasyC before but I talked to the programming mentor from another team and he suggested both the program and these forums. Where should I start so that I can advise the teams on how to complete their programming in a serious time crunch.

What information do I need to read that you can link me to?
What are the basic things I need to know, and where can I find the stuff that will put me there.

Also, I need code examples; I have experience with coding in java and vb.net and a host of web based stuff, but none with C; I need to know what FRC C code should look like.

Finally, I heard that the kits come with a lot of working code examples from the start; because of time constraints I think I'll have to use alot of these but the teams I'm working with are not the most organized and don't know where all their kit information and tools are. Pleaes direct me to links where I can find backups of all the FIRST code samples and programming guides.

Thank you.!
  #2   Spotlight this post!  
Unread 31-01-2007, 08:52
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

First off, welcome to the FIRST programming arena!

You should start by installing easyC on your computer, and making sure your COM port / USB-Serial adapter is working (You can check this out in device manager)

Then you can start coding.

easyC is set up so that when you make a new file, there are three blocks. Initilization, Autonoumous, and Operator Control. If you need help defining WHEN these occur, let me know.

You can put code in each of these block to occur during that time period. To start off with, open the Operator Control block by right clicking on it and hitting open.

Then you can put code inside of here. On the left under Program Flow, click and drag a while loop (If you know Java, you know what this is...) and put in 1 for the value to end up with a while(1) loop. This is like a while(true) loop in Java.

So now you have an endless loop. Anything you put inside this loop will occur over and over again forever. The idea is that each time this loop runs through, conditions are checked and stuff happens based on it. It would be a good idea to put some blocks on top to check to see if your E-Stop is enabled and to stop your motors if it is, but for right now, you just want to get something downloaded to your robot (I assume. I can create a follow-up post that gets into more detail.)

OK, so now you want to be able to drive the robot. On the left under RC Control (Or something like that, can't remember off the top of my head) is the Aracade 2 Motor Block. Click and drag this block INSIDE your while loop. Then configure the correct PWMs based on your bot. Hint: Typically you need to invert 1 motor because 1 motor is 'backwards'. If you did it the wrong way (you will find out later,) then just reverse them.

OK, so now you have a simple program. So you want to compile it. Click on the compile button in the toolbar above (A Stack of index cards with arrows on top of it (At least thats what I think it looks like...)). When thats done, click on the button to the right of that button to build and download it to your bot. Connect the serial cable to the Program port on your bot and press and hold the PROG button on the bot until the program state light turns orange. DO NOT CONTINUE TO HOLD DOWN THE PROG BUTTON!! This puts the controller into a funky state.

Ok, so now it should have downloaded your new program. MAKE SURE that your OI is off whenever you download a new program so that when it's done downloading it doesnt just start excecuting. This can be dangerous because if you aren't near the OI you can't unplug it, or it could rip the laptop out of your hands. After the program is downloaded, disconnect the serial cable, and turn on the OI, keeping your hand on the power to the OI, should you need to disconnect it.

You probably need to trim your POTS now, because the joysticks that come with the kit usually aren't trimmed, this can be done by turning the little dials on the top and side of the joystick until the motors stop humming/moving. Typically this is somewhere near the center position.

OK. This should be enough to get you started. Let me know when you are done with this, then give me some idea of the direction you want to go, and I can step through it with you.

Hope this help!,
Jacob

--
Remember, if this post was helpful, good Rep is always good....
  #3   Spotlight this post!  
Unread 31-01-2007, 09:01
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: HELP!

Also, open the help file and start at "Getting Started" there are a bunch of tutorials that show you how to write code for your robot and examples.

You may want to check out the online window as well it will show you how things move.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #4   Spotlight this post!  
Unread 31-01-2007, 09:21
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

Good point. The getting started manual built into easyC is very helpful, especailly when finding out more information about a particular block of code provided for you.

Jacob
  #5   Spotlight this post!  
Unread 31-01-2007, 09:35
Asheron Asheron is offline
Registered User
no team
 
Join Date: Jan 2007
Location: New Orleans
Posts: 13
Asheron is an unknown quantity at this point
Re: HELP!

Thanks, I'll take a look at both of those when I get back to the robotics lab this afternoon. I was wondering though if there were things available I could look at while at the office. I have my lunch break and a couple other low load times where it would be nice to have something to read over. I don't have access to EasyC or the computer I'll be working with while at work. I've done a few searches on these forms for beginners and newb coders but have returned no results.
  #6   Spotlight this post!  
Unread 31-01-2007, 09:46
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

OK cool.
I'm glad you are taking the initiative to do stuff, because I know a lot of people that wouldn't even want to try.

Alright. I'm going to tackle the code first, and then I'll look at your logistics.

In easyC, the 2WD Arcade block is REALLY easy. Once you place this block, it give you all of the options. It asks which port your joystick is on, which axis you want to use for both x and y, and which motors to control in which directions. No code involved. Its a GUI. This means you don't have to initialize varibles, get values, etc. easyC does it all for you.

As far as logistics. A few years back there was a simulator, but that was for the old PBASIC chip, and there is no new C simulator. It should be easy enough to set up your computer to download code to. Here is a link to the pdf with the wiring diagram:

http://www2.usfirst.org/2007comp_173...ON_DIAGRAM.pdf

All you need from this diagram is a path from the battery to the comptuer for power. You obviously don't need to hook up all of the spikes and victors and peripherals.

If you REALLY just want to get started, find a 12 volt transformer, cut whatever end is on it off, put spade connectors on the ends and hook it to the computer. This is NOT reccomended by FIRST, because it is not fused, but as long as it is a low amp power supply (i.e. <10 AMP max), it shouldn't be a problem.

OK, so here is some background.
The RC needs to be connected to the OI. The OI is where you connect your joysticks, and the RC is where you connect your motors etc, (a.k.a. The Computer.) The easiest way to do this is with the TETHER cable (The red serial cable.) This will power the OI over the tether cable without requiring additional power to the OI via a 9v transformer.

The other way to connect them is over the radio. You can use serial cables to connect the proper radios to the RC and OI (they should be labeled as to which is which)...

You then plug your computer into the Program port. This is how programs are downloaded. You need to put the processor in program mode by pressing the PROG button until the Program State light turns orange.

You can leave the serial cable plugged into the Program port to get feedback on the computer through the Terminal in easyC, if you put in PrintToScreen statements in your code. Be careful that you have control of the robot in this situations as not to rip your laptop off the desk.

Your devices are then plugged into the RC. You can plug your Speed Controllers (The Victors) into the PWM ports using the Black/Red/White wires. The Victors have varible control over the motors.

I would reccommend that you build your power system as soon as possible. This means the Distribution Block, the Black Circuit Breaker Panel, your computer, and a few devices. I say this because if you power your speed controllers, you can watch the lights change color based on the output of the PWM going to it. This can be used as an indicator as far as your program working.

What did I leave out? I'm sure I left something out somewhere...

Let me know,
Jacob

BTW, can I post this on CD? Other teams may have the same question, and I put a bit of time putting this together (I don't mind, in fact I love helping other teams, I would just like other teams to benefit.)





Quote:
Originally Posted by Asheron
Theres a problem, so far it looks to me like the team hasn't assembled a robot or a board. I do know what the parts are and have seen both the on-bot control board and the joystick control board (for lack of better terminology).

Is there some program or emulator I can send the code to that acts and gives feedback like the robot to check it until the robot is done?

I saw the serial ports ( I work 9 hours a day and will be getting about 3 hours a day with the team) and I'm assuming these are the ports I should know to recieve from and output to based on whats connected to them.

I know our drivetrain is going to be two wheel drive in the back with cart wheels (no motors attached just 360 degree rotating wheels like a grocery cart) on the front. I noticed like 4 or 5 modes in Easy C, which one would work with a two wheel drive? Just the regular 2 WD arcade? or the 2 WD tank mode?

I'm not looking at the code right now, but from what you mentioned and what I saw in the program, psuedocode would look like:

char joystick_x_axis = joystick_x_input
char joystick_y_axis = joystick_y_input

while (1) // endless loop to check for conditions
{
check for joystick position

control motion.

set pmw1 =

}

To control motion, I guess I'd have to set the motor speeds based on joystick position, so if the joystick is leaning right (signaling a right turn), I should slow down the right wheel so the left wheel would take over?

Could you provide me an example of how to control motor speeds based on joystick input?

I'm thinking, I should set the wheel for a specific motor based on subtracting the joystick x position from the joystick y position, so that the motor on the outside of the turn would be spinning faster based on the joystick position, example of what I'm thinking:

Joystick position = 45 degrees northeast (signalling right turn)
and Max motor speed and joystick control both = 255 with the starting position or no motor speed = 127

So, I'd have the left wheel moving at 200 maybe and I'd take and subtract the x -axis value of, lets say, 180, so I'd do a calculation:

set pmw1 = joystick_y_axis // 200 which is y-axis, N/S, value

set pmw2 = joystick_y_axis - (joystick x-axis - 127) // subtract from the y axis the x axis minus the 0 point).



Let me know if that logic makes sense, if not, how should it go? I'm not in front of easyC right now, I can't install it on my work computer neither can I get in to remote control the PC its on.
--
Remember, if this post was helpful, good Rep is always good....

Last edited by whytheheckme : 31-01-2007 at 09:48. Reason: Forgot something...
  #7   Spotlight this post!  
Unread 31-01-2007, 10:28
Asheron Asheron is offline
Registered User
no team
 
Join Date: Jan 2007
Location: New Orleans
Posts: 13
Asheron is an unknown quantity at this point
Re: HELP!

Again thanks much, I'm looking at the diagram and I'll do some considering over the next few hours and get back to you with questions. I don't want to waste too much of your time with questions that might entirely too simple to answer myself once I have my hands on the robot.

Post it where-ever you'd like, I appreciate the help and if other teams are as far behind as ours, I'm sure they will also.

Last edited by Asheron : 31-01-2007 at 10:32. Reason: additional text
  #8   Spotlight this post!  
Unread 31-01-2007, 10:29
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

No problem. I'd be happy to explain anything that needs explaining... I'm a 14 year old college student with a lot of time on his hands....


My next class isn't until 4:30 tonight.

Jacob
  #9   Spotlight this post!  
Unread 31-01-2007, 13:49
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: HELP!

14 !? They just keep making them younger and younger!
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #10   Spotlight this post!  
Unread 31-01-2007, 13:54
Asheron Asheron is offline
Registered User
no team
 
Join Date: Jan 2007
Location: New Orleans
Posts: 13
Asheron is an unknown quantity at this point
Re: HELP!

Nickname Genius, child prodigy. I hope you don't hit the parties and go out drinking! It would stunt your growth!
  #11   Spotlight this post!  
Unread 01-02-2007, 08:21
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

lol. I'm 6' 1" and still going...
Got some back problems though...

Anyway, I sent this PM. I wanted to put it up here so others can enjoy.

OK. I'm glad that you are able to get your robot moving. This is the first step to a working robot (from a programming aspect. Even though on our team the programmers wind up getting the mechanical team out of the jamb more times than not . jk. not really.)

Anyway, pnuematics. You need to hook the pressure regulator somewhere in your 120psi system to hook back to the computer via a digital input. This is what tells the compressor to turn off. You need a little bit of code that checks the Nason (I think it's Nason. Thats who made it last year. I haven't looked at it this year,) and if it's High (1) turn the compressor off. This means that your compressor needs to be on a relay. I think there is a block in easyC to put a Digital input directly to a varible, and then set the relay directly from a varible. There may be a more effecient way to do this. It must be done, check rule <R103>

Thats the compressor. All thats left are the pneumatic switches. These are simply attached to relays, and controlled via the computer. Remember that relays can do forward and reverse, and to always have that relay set in one of those positions, not off, because you have no idea what state the piston will be in if you do this.

You can control relays using built in blocks in easyC. If you need me to go into more detail, let me know, and I'll boot up my programming laptop and walk you through it.

Hope this helps,
Jacob Komar

--
Remember, if this post helped, good Rep is always good...


Quote:
Originally Posted by Asheron
Ok,
It looks like both I and my student programmer understand how to make the robot move (although we didn't get it wired last night - a team should be taking care of that today). We also went through the tutorials and I explained what the code easyC was putting together does.

My next question: I believe we are going to be using the air compressor and pnuematics system to telescope our arm up and down. Does easyC have a control system already programmed to handle that, or should I be looking up how to do that on my own?
  #12   Spotlight this post!  
Unread 01-02-2007, 08:32
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: HELP!

easyC has a block called "Pressure Switch" in outputs drag it into initialize and specify the relay and input port and it will watch the compressor for you.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #13   Spotlight this post!  
Unread 01-02-2007, 09:28
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

OK.

I'm going to explain how to setup a simple pneumatic system.
I'm assuming that your power system is completed (i.e. Your black circuit panel has power and you have some fuses in place.)
OK. So now you need hook up you electrical. You are going to need 2 relays to control one solenoid (1 for the compressor, 1 for the solenoid.) Put power to both relays form the circuit panel, and hook a black/red/white cable from each relay to a relay port on the RC. (1 and 2 are very convienent ports to use.) The air compressor can then be wired to one of the relays (Use relay 1, just for now.) Lets start off with a single solenoid valve (either the FESTO of the single SMC.) Wire this to the other relay (Relay 2.) The only thing left to wire is the pressure valve, which you can put into digital input 1. I don't remember if this comes with a connector on it that fits directly onto the board. If not, you will have to make one. One wire needs to be connected to black, and the other to white. Red is not used in this application. By the way, I am assuming you are hooking up all of the wires in the correct orientation as noted on each device (i.e. V- means black, White to White on black/red/white cables, etc...)

OK, so now you can hook up your pneumatic system. It should look like page 11 of this:

http://www2.usfirst.org/2007comp/oth...s%20Manual.pdf

Yes, you need all the regulators, yes you need all of the gauges, yes you need the tanks (at least 1), and yes you need the Nason. You have no choice on these things, so if all of that is too much weight, then you can forget pneumatics now.

All of that stuff just fits together with the supplied fittings and hose, along with a bit of teflon tape (essential.)

OK, so all thats left is your program. I attached a sample program written in easyC; It turns out there is a pressure switch block now available (I don't remember that from the old version.... Oh well, I don't really use easyC all too often anyway...) For your convience I copied and pasted the code below so that you can at least view it now. I commented it. It is very simple.

#include "Main.h"
void OperatorControl ( void )
{
while ( 1 )
{
Arcade2 ( 1 , 1 , 1 , 2 , 1 , 2 , 0 , 1 ) ; // A nice little drive block
InitPressureSwitch ( 1 , 1 ) ; // This turns on and off your compressor
OIToRelay ( 1 , 1 , 2 , 1 ) ; // Switches the solenoid one way with the trigger
OIToRelay ( 1 , 2 , 2 , 2 ) ; // Switches the solenoid the other way with the thumb button
}
}



And that should be it. Let me know when you have more questions.

Jacob

> I'd like
> to make the time with the students as productive as possible, so if you can walk
> me through it while I'm at work and I can get the understanding. I'll be bette
> prepared to help them. Next year's first will go much smoother I believe
> because I'll be involved from day one instead of mail in day - 20.
Attached Files
File Type: zip samplePneumoCode.zip (2.0 KB, 33 views)

Last edited by whytheheckme : 01-02-2007 at 09:29. Reason: Forgot to upload file
  #14   Spotlight this post!  
Unread 01-02-2007, 10:30
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: HELP!

This is not correct but close. The presure switch only needs to be called once. Good work though.

void OperatorControl ( void )
{
while ( 1 )
{
Arcade2 ( 1 , 1 , 1 , 2 , 1 , 2 , 0 , 1 ) ; // A nice little drive block
InitPressureSwitch ( 1 , 1 ) ; // This turns on and off your compressor
OIToRelay ( 1 , 1 , 2 , 1 ) ; // Switches the solenoid one way with the trigger
OIToRelay ( 1 , 2 , 2 , 2 ) ; // Switches the solenoid the other way with the thumb button
}
}

This is correct.

void Initialize ( void )
{
InitPressureSwitch ( 7 , 1 ) ; (Input Port,Relay Port)
}

void OperatorControl ( void )
{
while ( 1 )
{
Arcade2 ( 1 , 1 , 1 , 2 , 1 , 2 , 0 , 1 ) ; // A nice little drive block
OIToRelay ( 1 , 1 , 2 , 1 ) ; // Switches the solenoid one way with the trigger
OIToRelay ( 1 , 2 , 2 , 2 ) ; // Switches the solenoid the other way with the thumb button
}
}
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #15   Spotlight this post!  
Unread 01-02-2007, 12:50
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: HELP!

Ah, OK.

Good catch. Thanks. I have never used this before... I don't think it was available (right? or am I just dilutional?)... I've always done it manually in the loop...

Maybe you can tell me,

Why does the drive code need to be in the loop, but not this pressure code? It seems like it should check every time... Unless it is something like a header, where it just permanently assigns that digital input to the relay? Perhaps you can explain how this works?

Thanks,
Jacob
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
section 'InterruptVectorLow' type is non-overlay (was: HELP HELP HELP!!!!!) naor52 Programming 14 24-02-2007 01:19
Help: How do we get a teacher to help? (was: Help) ChaosAlchimey General Forum 13 21-01-2007 11:57


All times are GMT -5. The time now is 10:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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