View Single Post
  #5   Spotlight this post!  
Unread 07-03-2013, 08:06
jimwick's Avatar
jimwick jimwick is offline
jim wick
FRC #0885 (the Green Team)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: tunbridge, vermont
Posts: 94
jimwick is a glorious beacon of lightjimwick is a glorious beacon of lightjimwick is a glorious beacon of lightjimwick is a glorious beacon of lightjimwick is a glorious beacon of light
Re: Setting up a Victor 888 with an arduino

I am a newbie when it comes to arduino programming, or any programming for that matter, but I was able to make a Victor work somewhat. It actually ran a small motor in both directions with sort of jerky speed control.

I used "include <servo.h> which pulls in the servo function from the library.
I used "myservo.attach(9)" so set the output on a PWM pin.
I also used the "map" function to convert joystick values to the 0 to 180 that the Victor needs. This is key.
I used myservo.write(val) to send the value to the Victor.

I hesitate to upload the whole code because I have included a lot of junk to overcome a very noisy and non-linear joystick.

Hope this helps.