Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Free programming help (http://www.chiefdelphi.com/forums/showthread.php?t=41998)

iBheat 18-01-2006 19:59

Re: Free programming help
 
Here are the default code pwm and relay linkings with the joysticks and digital inputs

Code:

//PWMs

  pwm01 = p1_y;  //PWM01 value is the Y Axis on Joystick 1
  pwm02 = p2_y;  //PWM02 value is the Y Axis on Joystick 2
  pwm03 = p3_y;  //PWM03 value is the Y Axis on Joystick 3
  pwm04 = p4_y;  //PWM04 value is the Y Axis on Joystick 4
  pwm05 = p1_x;  //PWM05 value is the X Axis on Joystick 1
  pwm06 = p2_x;  //PWM06 value is the X Axis on Joystick 2
  pwm07 = p3_x;  //PWM07 value is the X Axis on Joystick 3 
  pwm08 = p4_x;  //PWM08 value is the X Axis on Joystick 4
  pwm09 = p1_wheel;  //PWM09 value is the wheel on Joystick 1
  pwm10 = p2_wheel;  //PWM10 value is the wheel on Joystick 2
  pwm11 = p3_wheel;  //PWM11 value is the wheel on Joystick 3
  pwm12 = p4_wheel;  //PWM12 value is the wheel on Joystick 4
  pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);  //Use Joystick 1 to drive 2 motors (pwm13 and pwm14)
  pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);  //Use Joystick 1 to drive 2 motors (pwm15 and pwm16)

//RELAYs

  relay1_fwd = p1_sw_trig & rc_dig_in01;  //Trigger relay1 forward only if Joystick 1 trigger is pushed and digital in 1 is true
  relay1_rev = p1_sw_top  & rc_dig_in02;  //Trigger relay1 reverse only if Joystick 1 top button is pushed and digital in 2 is true
  relay2_fwd = p2_sw_trig & rc_dig_in03;  //Trigger relay2 forward only if Joystick 2 trigger is pushed and digital in 3 is true
  relay2_rev = p2_sw_top  & rc_dig_in04;  //Trigger relay2 reverse only if Joystick 2 top button is pushed and digital in 4 is true
  relay3_fwd = p3_sw_trig;  //Trigger relay3 forward with trigger on Joystick 3
  relay3_rev = p3_sw_top;  //Trigger relay3 reverse with top switch on Joystick 3
  relay4_fwd = p4_sw_trig;  //Trigger relay4 forward with trigger on Joystick 4
  relay4_rev = p4_sw_top;  //Trigger relay4 reverse with top switch on Joystick 4
  relay5_fwd = p1_sw_aux1;  //Trigger relay5 forward with Aux1 switch on Joystick 1
  relay5_rev = p1_sw_aux2;  //Trigger relay5 reverse with Aux2 switch on Joystick 1
  relay6_fwd = p3_sw_aux1;  //Trigger relay6 forward with Aux1 switch on Joystick 3
  relay6_rev = p3_sw_aux2;  //Trigger relay6 reverse with Aux2 switch on Joystick 3
  relay7_fwd = p4_sw_aux1;  //Trigger relay7 foward with Aux1 switch on Joystick 4
  relay7_rev = p4_sw_aux2;  //Trigger relay7 reverse with Aux2 switch on Joystick 4
  relay8_fwd = !rc_dig_in18;  //Trigger relay8 foward with digital in 8 usually used with the compressor
  relay8_rev = 0;  //Do not allow relay8 to be reversed usually used with the compressor

And then the PWM lights on the controller are driven by the corresponding PWM port!

Enjoy and feel free to correct me if I am incorrect with any of these!

Cuog 18-01-2006 20:06

Re: Free programming help
 
yes thats correct i just didnt have my code or my code book with me

Dillon Compton 18-01-2006 21:01

Re: Free programming help
 
Quote:

Originally Posted by Packmon's_girl
Yes, I am on a rookie team, and given the fact that our school will not let us download the c compiler and the MPlab program to our computers, and my mentor wants me to find out if we put such gear drive to such pmw and have it work basically, THIS WEEK, how am I supposed to do it, and also, I have looked at the tutorial from the US first website,and I am still confused about c programming and would like some help understanding it.
Please can anyone help, I would be deeply indebted to you if you would.
Thank you.

PS sorry for any typos,or mispellings.


Hi Rebekah, and welcome to Chief Delphi.

Something you may want to consider, if you feel you dont have the time/resources/support to tackle learning C programming in time to get a functioning robot (with an autonomous mode even, perhaps?), is the new software that intellitek provided all FIRST teams with this year; EasyC. EasyC is a GUI (Graphical User Interface) C programming tool that allows users to literally "Drag and Drop" blocks of C code. While you still need a basic understanding of program flow (if/then, else, loops, etc...), this program can DRASTICALLY reduce the learning curve and get you a functional program in very little time...

More info about EasyC can be found here: http://www.chiefdelphi.com/forums/sh...ad.php?t=41590
and
http://www.chiefdelphi.com/forums/sh...ad.php?t=41333

I would highly suggest contacting your district and requesting installation of whatever development tools you choose on at least one machine in the school. Another option is if a team member has a laptop or spare desktop, you can set up a programming computer off of the network, so the district has no control over it. If all else fails, you absolutely NEED them to allow the installation of IFIloader on a computer WITH A SERIAL PORT (Or USB with a USB to Serial adapter Cabler...I've had good luck with the radio shack brand) AND ACCESS TO THE ROBOT, otherwise those nifty .hex files you compile at home(or at school, with luck) will be unable to be loaded to the Robot Controller (and that just wont do!).

If there is anything else I can do to help, you can drop me an email at DespoticDreamer@gmail.com or an IM (AIM, none of this MSN Messenger silliness...) at DespoticDreamer


Good luck!

-Dillon Compton

Dale(294engr] 18-01-2006 21:16

Re: Free programming help
 
Cuog & ALL FIRST Teams,
I propose all (many?) teams collaborate on a 'Simple Set Path' Autonomous Strategy (SSPA) via a CD forum. (SSPA?)

PRO: when cooperating teams ally they will score above average together in the auton. period. (AP)
(increase chance of near or perfect 100 pt AP score) by avoiding random collisions
i.e. use preset paths for each start position, so all have higher avg qual scores than those who don't.
FIRST leaders, members & spectators will be happy with high scores !

CON:
Drive accuracy & shooting apparatus effectiveness will determine indiv best AP score.
No ally may be able to score from 18' effectively.

SSPA proposal: (prepgm modes)
define 3 starting robot positions: Lead, Mid, Back (LMB)

3 bots drive straight line angle from LMB to centerline,
8', 13', 18' from goal base, respectively & shoot 10 balls

Provides 2' in front of ramp for lead bot and ~2' between remaining ~36" bots

Engage CMUcam correction near end of fast init drive for AZ & EL then shoot.
(some will have to turn bot frame, others have a tracking turret)

Overwhelming advantage is the if each can drive within the 2' margin corridor
they will not bump into alliance partners permitting max score potential.
Partners may choose to put better distance shooters in the M/B positions.

18' should take only 3 sec, leaving 7 sec to align & stabilize and shoot 10

Alternative scheme (prepgm mode): (increased risk of collision)
L&M shoot quickly and move away from center
allowing B to drive forward after a TBD 2-3sec? delay then shoot from closer

Regards, Dale (294engr]

Packmon's_girl 19-01-2006 14:29

Re: Free programming help
 
TO tell the truth the only things I know about the programming, is that there are if statements and else statements, and I'll see if my mentors will let me install the MPlab on my home computer, and possibly I could bring it to school to use there, because I have no real connections on it, and I have no internet, I think though that with the help you have given me I can at least help them to make sure that the motors and joysticks work.
Yes, I will let you know if I end up needing further help, which I know I will, because none of my mentors know anything about c-programming.

Thank you in advance.

Cuog 19-01-2006 19:09

Re: Free programming help
 
Since you are the only member of your team programming there should be o problem for you to install a copy of MPLAB etc. on your home computer(i have it on 2 of my own computers) also if you need a more in depth tutorial on how to program for FRC you can either search these forums white pages or you can wait a bit and i will try and write a nice tutorial if there is any interest.

Packmon's_girl 20-01-2006 14:00

Re: Free programming help
 
Hey, if you can write a tutorial for someone who knows nothing pretty much like an Idiots Guide to C, That would be great, but also my mentor is bringing in a programmer from another team to help me out.

Cuog 20-01-2006 14:08

Re: Free programming help
 
Ok i will get to it keep your eyes open for an initial release some time this weekend.

Cuog 24-01-2006 15:32

Re: Free programming help
 
OK i finished the programming guide http://www.chiefdelphi.com/forums/pa...le&paperid=592

feel free to download it and read it i hope it will help people.

Packmon's_girl 24-01-2006 16:43

Re: Free programming help
 
Thank you, as soon as my teacher downloads it I will read it, because you see, I am at school, and the school computers will only let teachers download things.


All times are GMT -5. The time now is 00:11.

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