View Single Post
  #22   Spotlight this post!  
Unread 09-06-2015, 18:00
Rman1923's Avatar
Rman1923 Rman1923 is offline
Registered User
AKA: Rohan Chatterjee
FRC #1923 (The MidKnight Inventors)
Team Role: Leadership
 
Join Date: May 2013
Rookie Year: 2013
Location: Plainsboro, NJ
Posts: 48
Rman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond reputeRman1923 has a reputation beyond repute
Re: Arduino Micro with Talon SR

Quote:
Originally Posted by SuperBK View Post
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.
This is pretty cool, I'm going to try this. Do you think if I mod the servo call to attach(1500,2000) it will only go forward? Also, I can just do the digitalwrite() function to control this right?
Thanks!
__________________

My posts do not reflect the values and opinions of my team
Build Co-Captain for The MidKnight Inventors
FLL Mentor for The Robot MasterMinds

FTC Student Mentor for MidKnight Magic

2015 Dean's List Finalist