View Single Post
  #22   Spotlight this post!  
Unread 09-06-2015, 17:19
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 358
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Arduino Micro with Talon SR

You can also specify the servo min and max pulse widths in the attach call:

Servo driveServo;
driveServo.attach(3, 1000, 2000); // TALON // widths are in micro-seconds

Then use servo.Write() 0 is reverse, 90 is stop, and 180 is full forward.

I would still calibrate the Talon (or other motor controller) to ensure it goes full speed. Write an arduino sketch that starts at neutral and waits for a character to arrive from the serial port. Then have it switch to servo to full speed forward, wait for another character and then go full reverse. After waiting for another character, go to neutral. Use Serial.Print to tell the user whats going on and prompt for a character. If you use the serial port monitor in the arduino IDE, you will have to click the "Send" button after each key.

One other thing: I put a 330 ohm resistor in series with the white wire driving the PWM input on the Talon so it doesn't try to drive too much current through its input opto-isolator.
__________________
Brian K
Team 1225 Robotics Mentor