Thread: Code problems
View Single Post
  #2   Spotlight this post!  
Unread 15-02-2005, 12:03
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Code problems

Quote:
Originally Posted by doyler
2)When I go full on with p1 it ends up overlapping and going in reverse
Joystick maximum is 254. Your code does something with the joystick value to get a number from 0 to 127. Your lookup array only goes to 126, so you're falling off the edge and picking up an undefined result. Make your table bigger by one. You might also consider initializing it as part of its declaration rather than having a whole bunch of code in a function to do it.
Code:
static char lookup[128] = (0,0,0,0,0,0,1,1,2,2,2,3,4,4...);
Quote:
3)There is rhythmic pulsing coming from the pwms (i hooked up a servo and it kept moving without any joystick interaction)
You're using pwms 13-16. They are generated by the RC user processor. When other interrupts are being used in the system, the pwm outputs jitter. Change to other pwm outputs, which are generated by the master processor and are not subject to the same interference.