View Single Post
  #10   Spotlight this post!  
Unread 17-01-2013, 03:45
TAHIRisHERE's Avatar
TAHIRisHERE TAHIRisHERE is offline
Registered User
FRC #0334
 
Join Date: Jan 2013
Location: New York City
Posts: 1
TAHIRisHERE is an unknown quantity at this point
Re: CIM->Victor 884->Arduino not working

you will have to use the aruidno servo library to have the arduino generate PWM signals. As seen here, http://playground.arduino.cc/ComponentLib/servo

you would have to attach the black wire(from victor) to any ground pin.
Then the white to an arduino pin with PWM(i think its has a curvy line next to pin number label.)
Then the red wire you have no use for.

so a simple sample:


#include <SoftwareServo.h>

Servo myservo(any name can be put here this example uses myservo); // create servo object to control a servo
// a maximum of eight servo objects can be created

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{ myservo.write(0) (writing the servo at value of 0 will spin motor full speed coutnerclockwise. and a value of 180 will spin motor to full speed in clockwise direction. and a value of 90 is no spin or stop) }


I will assume you know how to wire the battery to the victor.

the sample code is not perfect there are mistakes. but i hope it helps.