We’re thinking about starting a vex IQ program at our school so I bought one to “familiarize myself” (play with). This is the first robot I built, just for fun I decided to bust out my MacGuyver programming skills and write a taylor series approximation for sine and cosine using modkit. It took me forever to debug the code, there was an obvious error staring me right in the face and I kept looking right past it. D’oh
I included annotated code. And yes, that is a lot more digits of Pi than I really need. I reduced it in later iterations of the code and it didn’t seem to make any difference.
I didn’t include code for the individual motors, it will only allow me to post 5 images.
It is simple though:
Motor 1: x/3+y/1.732+r
Motor 2: x/3-y/1.732+r
motor 3: -2x/3 +r
Obviously, these values aren’t running the motors as fast as they could be. I might add a normalizing algorithm to be used if the joystick is in a max position.
My next step is going to be to code it with robotC and see if it doesn’t process the trig faster (I’m sure it will)