Hello, everyone. I am new to OF and I’m learning as much as I can from this forum. Thanks for all the effort.
I have reached a stumbling point and I’m really banging my head against the wall. I just want to get a servo connected to my Arduino Duemilanova and have it respond to a slider. It seems nothing I do can get the servo to move. The only thing that seems to actually do anything is to set my pin mode to ARD_PWM then setPwm( pinNum, sliderNum ). But, the behavior seems almost random, not really controlled by the gui slider.
I can’t find any documentation on how to do this? Anyone ever control a servo through OF using an Arduino?
I am running StandardFirmata on my board. Am I crazy, or is ofArduino not for use with Firmata?
Any help would be greatly appreciated!!
Here is my code. After Arduino starts up, it does nothing.
void testApp::setupArduino(){
ard.sendDigitalPinMode( servoPin, ARD_OUTPUT );
ard.sendServoAttach( servoPin );
}
// Called on update loop
void testApp::updateArduino(){
ard.update();
ard.sendServo( servoPin, sliderNum ); //sliderNum is an instance var
}