View Single Post
  #6   Spotlight this post!  
Unread 16-01-2013, 23:40
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: CIM->Victor 884->Arduino not working

I've never tried this personally, but if I had to hazard a guess it would be that delay takes an unsigned long as an argument, but you're passing a floating-point time. You probably want to use delayMicroseconds(). Also, the WPILib comments say that the Victor prefers 10ms periods.

You might also want to check out the Servo library. It's designed for servos that go to specific angles, but it should work for this case as well. I think you'd want to use writeMicroseconds() for the high pulse, and then just delay for the remainder of the period.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"