| Author |
Message |
Djacwmwfin Joshamuffin Vampire

Joined: 12 Jun 2007 Posts: 3539
HP: 100 MP: 5 Lives: 0
|
Posted: Mon Feb 11, 2008 10:19 pm
|
|
|
I am now thrice a successful programmer of the robot.
If any of you recall my ball push code, that was my first one. http://digibutter.nerr.biz/viewtopic.php?t=62369
Today I did 2 more. If you need info on the competition go to usfirst.org
/******************************************* *Forklift Code* *Written by Josh Brown AKA Joshamuffin.* *This program is your doom.* *2008* * *Forklift Driver press Right Trigger (p4_sw_trig) to go out/in.* *******************************************/
//Initialize variables for Forklift Code int doomFork = 0; //in = 0, out = 1 int doomAntiGun = 0; //off = 0, held = 1
if(p4_sw_trig == 1 && doomAntiGun == 0) //Has the trigger been pulled? { doomAntiGun = 1; //The trigger is held. if(doomFork == 0) //If it is in... { doomFork = 1; //Signal "OUT" } else //If it is out... { doomFork = 0; //Signal "IN" } }
if(p4_sw_trig == 0 && doomAntiGun == 1) //Has the trigger been released? { doomAntiGun = 0; //The trigger has been released. }
if(doomFork == 0) //If the signal is "IN" { relay3_fwd = 1; //Go in... relay5_fwd = 0; //not out. } else //If the signal is "OUT" { relay3_fwd = 0; //Not in... relay5_fwd = 1; //but out. } // printf("doomFork %3d, p4_sw_trig %3d, doomAntiGun %3d \r"doomFork,p4_sw_trig,doomAntiGun); /******************************************* *End of Forklift Code* *******************************************/
NEXT
/******************************************* *Forklift Hybrid Code* *Written by Josh Brown AKA Joshamuffin.* *This program is normal.* *2008* * *Robocoach hold down to lift forklift.* *******************************************/ if (rc_dig_in05 == 1) //If upper limit switch is activated... { pwm02 = 127; //Stop motor. } else if (rc_dig_in06 == 1) //If lower limit switch is activated... { pwm02 = 127; //Stop motor. }
if (CurrentSignal == 3 && rc_dig_in05 == 0) //If down button is pushed & upper switch not activated... { pwm02 = 255; //Turn motor forward. } else if (CurrentSignal != 3 && rc_dig_in06 == 0) //If down button is not pressed & lower switch not activated... { pwm02 = 0; //Turn motor backwards. }
// printf("UpperLimit %3d, LowerLimit %3d, pwm02 %3d
\r"rc_dig_in05,rc_dig_in06,pwm02); /******************************************* *End of Forklift Hybrid Code* *******************************************/ |
|
| Back to top |
|
 |
RAWRRAWRRAWRwithtophatlol Sumakima Josindu
Joined: 03 Feb 2008 Posts: 2565
HP: 50 MP: 9 Lives: 0
|
Posted: Mon Feb 11, 2008 10:42 pm
|
|
|
|
*Brain asplodes* |
|
| Back to top |
|
 |
Super ShadowArticuno
Joined: 10 Jun 2007 Posts: 29080
HP: 99 MP: 5 Lives: 0
|
Posted: Tue Feb 12, 2008 12:03 am
|
|
|
| Sumakima Josindu wrote: | | *Brain asplodes* |
What the man who is aparently crazy just did. |
|
| Back to top |
|
 |
Logic King vg Vampire
Joined: 19 May 2007 Posts: 2032
HP: 90 MP: 10 Lives: 0
|
Posted: Tue Feb 12, 2008 6:49 am
|
|
|
|
Interesting. Is there a link to your 3 week video somewhere? |
|
| Back to top |
|
 |
Djacwmwfin Joshamuffin Vampire

Joined: 12 Jun 2007 Posts: 3539
HP: 100 MP: 5 Lives: 0
|
Posted: Tue Feb 12, 2008 7:25 am
|
|
|
| vg wrote: | | Interesting. Is there a link to your 3 week video somewhere? |
What do you mean 3-week video? |
|
| Back to top |
|
 |
Logic King vg Vampire
Joined: 19 May 2007 Posts: 2032
HP: 90 MP: 10 Lives: 0
|
Posted: Tue Feb 12, 2008 7:30 am
|
|
|
|
Huh. nevermind. I just remember our team doing some three week video and making a big deal of it. |
|
| Back to top |
|
 |
Djacwmwfin Joshamuffin Vampire

Joined: 12 Jun 2007 Posts: 3539
HP: 100 MP: 5 Lives: 0
|
Posted: Tue Feb 12, 2008 4:48 pm
|
|
|
| vg wrote: | | Huh. nevermind. I just remember our team doing some three week video and making a big deal of it. |
Well... my team isn't doing that. |
|
| Back to top |
|
 |
|