Hi,
Im trying to use Micro Maestro Servo Controller with math lab. I have this code:
function moveServo(s,x)
ser1 = serial('COM13');
set(ser1, 'InputBufferSize', 2048);
set(ser1, 'BaudRate', 9600);
set(ser1, 'DataBits', 8);
set(ser1, 'Parity', 'none');
set(ser1, 'StopBits', 1);
fopen(ser1);
fwrite(ser1, [128, 12, 4, s, binvec2dec(bitget(x,8:13)), binvec2dec(bitget(x,1:7))]);
fclose(ser1);
delete(ser1);
But simply, doesnt work for me. My micro maestro usb led (green) , flash when I try to send information with this code but the servo doesnt do anything.
I saw a friend using a similar code that work but his code was with a Matrix, I believe.
Hello.
Did you set the Maestro’s serial mode to USB Dual Port ? How did you choose COM13?
You might find this post and code helpful:
Hello, sreekanth.
The Maestro has virtual COM ports that can be used just like any other serial port, so if you figure out how to send bytes to a serial port in Matlab you can use the Maestro.
The first step is to set the Maestro’s serial mode to USB Dual Port and determine the COM port number of the Maestro’s Command Port by looking in the Device Manager (assuming you are using Windows).
I have never used Matlab, but this code will probably work for you. It was adapted from a post by sc9205…
When you get it working, please post your code here and tell us anything else you had to do. This will help future people who are in your position.
–David