View Single Post
  #3   Spotlight this post!  
Unread 24-02-2015, 08:03
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using xbox thumbstick to control servos on pan/tilt

Like Alan, I'm not sure what you want, but here are the two things I'd suggest.

1. Instead of setting the servo to the X and Y values of the joystick, use them to increment the value of the servo. You'll want to have a shift register that is initialized to zero, and add a fraction of the joystick each time through the loop. Send that to the servos.

2. Only update the servo value based on a button.

I'm also testing to see if the code snippets work when attached like this, but they should at least show you what the code should look like.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Servo Tilt Code.png
Views:	20
Size:	18.6 KB
ID:	18473  Click image for larger version

Name:	Servo Button Code.png
Views:	11
Size:	14.9 KB
ID:	18474  
Reply With Quote