Quote:
Yummmmmmmm GLOMP (6:17:00 PM): hahahaha
Yummmmmmmm GLOMP (6:17:05 PM): we're working out some code
mobile xufer (6:17:29 PM): oh
mobile xufer (6:17:54 PM): just to make people laugh i made my code humerous ...
Yummmmmmmm GLOMP (6:18:00 PM): LOL
mobile xufer (6:18:13 PM): alot my variables end in izzle
Yummmmmmmm GLOMP (6:18:20 PM): hahahah
Yummmmmmmm GLOMP (6:18:21 PM): I have to see this
mobile xufer (6:18:28 PM): ill show you a section of it
mobile xufer (6:18:44 PM):
if (-1 <= leftizzle[2] < (inch*80.5))
{pwm01 = 180;}
Yummmmmmmm GLOMP (6:19:21 PM): SO CONFUSING
Yummmmmmmm GLOMP (6:19:22 PM): argh
Yummmmmmmm GLOMP (6:19:27 PM): post that on my programming thraed
Yummmmmmmm GLOMP (6:19:28 PM): and explain it
|
alright so heres a section of it
Code:
Here are the main variables
#define pi 3.14159265358979 //defines pi
#define wheel (8*pi) //defines the circumferance of our wheels
#define wheeltick (wheel/32) // defines the ammount that the wheel moves in each tick
#define inch (1/wheeltick) // sets each tick into an inch form for ease of calculating distances
/*---------------------------------------------------*/
//basicly whats done here is reseting all the values to 0
int leftizzle[3] = {0, 0, 0};
int rightizzle[3] = {0, 0, 0};
int startposit; //not covered in this code segment, is the switch for case statements
int step = 0; // not covered in this code segment, but i do the auton in steps so that it resets its self throughout each phase
//that concludes resetting the values
/*------------------------------------------------*/
//now onto this bit of code
if (-1 <= leftizzle[2] < (inch*80.5))
{pwm01 = 180;}
basic setup is
if (condition)
{action}
the condition here is the value of leftizzle if the value is true then the motor will go forward at the above speed
to explain the condition if the variable leftizzle[2] the second part of the leftizzle set marked by an x (0,x,0)
if leftizzle is greater than or equal to -1 and less than 80.5 inches then the robot moves forward...
hope that wasnt too confusing
__________________
If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.
Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy
Photonics, It's Your Future