|
Re: intermdiate programmer requests your help!!!
and your limit switch will depend on how it's wired. 1 could be open or closed depending on the wiring. test with a multimeter first. for the 13.5 feet part, use encoders (might be hard), or measure the time that it takes your robot to go 13.5 feet and use timers (sample code):
Code:
int time;
if(time<115){ //this is about 3 seconds, 1 is 26.2 milliseconds
pwm01=pwm02=254;
time++;
}
else{
pwm01=pwm02=127;
if(!limit_switch){ //again, remember the wiring thing
claw_motor=254; //redefine claw motor, and this is assuming that 254 is up, and that ur not using a relay
}
else{
claw_motor=127; //same deal
}
}
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams
5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)
We have blades on our robot?! ***sweeeeeet***
There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
|