Hi,
I am attempting to get one of the example scripts to work with my Pololu Maestro Micro (FW1.04) and Arduino Pro Micro(atmega32u4@5v) or Arduino Nano.
I have verified that the Pololu Maestro works when connected to the Maestro control panel.
The serial settings are UART fixed at 9600 baud (*also attempted 115200)
CRC is disabled.
I atttempted this setup basically: https://www.pololu.com/blog/456/maestro-servo-controller-arduino-library
I connected the Arduino simply by connecting TX(A) to RX§ and RX(A) to TX § and GND(A) to GND§
The Arduino is connected with its usb to a 5v wallsocket adapter, and the Pololu is connected to a 5v wallsocket on the two battery pins under the servo connectors, but its usb is unplugged. Both are switched on by the same powerswitch.
This is primarily the code i’ve been trying to get to work:
#include <PololuMaestro.h>
//#include <SoftwareSerial.h>
//SoftwareSerial MySerial(5, 6); // RX, TX
//SoftwareSerial MySerial(4, 5); // RX, TX
//MiniMaestro maestro(Serial);
MicroMaestro maestro(Serial1);
//MicroMaestro maestro(Serial);
//MicroMaestro maestro(MySerial);
void setup()
{
// Set the serial port's baud rate.
//MySerial.begin(115200);
//MySerial.begin(9600);
//Serial1.begin(115200);
Serial1.begin(9600);
//Serial.begin(115200);
//Serial.begin(9600);
}
void loop()
{
/* setTarget takes the channel number you want to control, and
the target position in units of 1/4 microseconds. A typical
RC hobby servo responds to pulses between 1 ms (4000) and 2
ms (8000). */
// Set the target of channel 0 to 1500 us and channel 1 to 1750 us.
maestro.setTarget(0, 5000);
// maestro.setTarget(1, 8000);
//maestro.setTarget(0, 1000);
//maestro.setTarget(1, 2000);
// Wait 2 seconds.
delay(2000);
// Set the target of channel 0 to 1250 us and channel 1 to 2000 us.
maestro.setTarget(0, 8000);
//maestro.setTarget(1, 5000);
//maestro.setTarget(0, 2000);
//maestro.setTarget(1, 1000);
// Wait 2 seconds.
delay(2000);
}
The Serial1 should be used on the Micro according to resources I’ve found on the topic, but I also tried with SoftwareSerial on other ports (which should bypass this issue if I understand it correctly) but with no result.
Arduino Pro Micro:
Serial (TX0, RX1)@ 115200 = leds off, no response
Serial (TX0, RX1)@ 9600 = leds off, no response
Serial1 (TX0, RX1)@ 115200 = red+yellow led on Maestro are enabled.
Serial1 (TX0, RX1)@ 9600 = red+yellow led on Maestro are enabled.
MySerial (5, 6)@ 115200 = red led flashing at steady interval
MySerial (4, 5) @ 9600 = red led flashing at steady interval
(If I set Pololu on 115200, it sets itself to 115385 baud.)
(If I set SoftwareSerial MySerial,MicroMaestro maestro(MySerial) and instead of
MySerial.begin(9600); do Serial.begin(9600);, then it flashes red first and then yellow in regular interval.)
Arduino Nano:
Serial (TX1, RX0)@ 9600 = red led flashing at steady interval
MySerial (D4,D5)@ 9600 = red led flashing at steady interval
Also attempted 4800, 100000, 19200 baud.(set both on Pololu settings and Arduinocode)
What could I be doing wrong?