View Single Post
  #6   Spotlight this post!  
Unread 26-05-2012, 18:19
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Arduino PWM output

Quote:
Originally Posted by sand500 View Post
Yea I understand that PWM controls the speed of the motors, but I dont know if the duty cycle of the arduinos are the same as what a jag and victor takes.
Check out the writeMicroseconds function. Snippet from my code that controls a jaguar (working and controls a robot and stuff):
Code:
Servo jag;
    jag.attach(9);
    int8_t jagspeed

    // ... set jagspeed to a value from -100 to 100

    // Jag datasheet says it wants a puse between .67ms and 2.33ms
    jag.writeMicroseconds(map(jagspeed, -100, 100, 670, 2330));