Hello All,
I am attempting to control a servo using the Micro Maestro 6 and processing processing.org/. I was unable to find any online resources on how to do this.
Based on my experience with other servo controllers such as:
SSC-32 lynxmotion.com/p-395-ssc-32- … oller.aspx
And
SD-84 robotshop.com/devantech-sd84 … oller.html
And what I could gather from the User’s Guide here is the processing code I am attempting to use:
import processing.serial.*;
Serial myPort; // Create object from Serial class
void setup() // run once, when the sketch starts
{
myPort = new Serial(this, "/dev/tty.usbmodem00054531", 115200, 'N', 8, 2.0);
/*
with MSB set
For example, if we want to set the target of servo 0 to 1500 µs, we could send the following byte sequence:
in hex: 0x84, 0x00, 0x70, 0x2E
in decimal: 132, 0, 112, 46
myPort.write(0x84);
myPort.write(0x00);
myPort.write(0x70);
myPort.write(0x2E);
*/
/*
with MSB cleared
For example, if we want to set the target of servo 0 to 1500 µs for a Maestro with device number 12, we could send the following byte sequence:
in hex: 0xAA, 0x0C, 0x04, 0x00, 0x70, 0x2E
in decimal: 170, 12, 4, 0, 112, 46
*/
myPort.write(0xAA);
myPort.write(0x0C);
myPort.write(0x04);
myPort.write(0x00);
myPort.write(0x70);
myPort.write(0x2E);
//*/
}
void draw()
{
/*
For example, if we wanted to set the target of servo 0 to its (configurable) neutral position, we could send the following byte sequence:
in hex: 0xFF, 0x00, 0x7F
in decimal: 255, 0, 127
*/
myPort.write(0xFF);
myPort.write(0x00);
myPort.write(0x7F);
delay(20);
}
When I run this code in processing the green LED on the Maestro blinks rapidly indicating that data is getting through but the servo connected to channel 0 does not move or even freeze in a locked position position. I can easily turn the horn with my hand indicating to me that no data or power is going to the servo.
I am able to control servos using the Maestro Control Center software.
The processing sketch is being run on:
Mac OSX 10.7.5
Processing v2.0b
I have tried selecting both:
UART, fixed baud rate 115200
And
UART, detect baud rate
On the Maestro Control Center….
I suspect there is an issue with how I am setting the servo up with the hexadecimal commands. Does anyone have any ideas?
Thank you,