I have R2D2 and a 12-channel Mini Maestro connected to an Arduino with a Padawan 360 system. Everything works perfectly. The Maestro is working, and all the servos in the body are fine. I’m trying to connect a remote control that will open the panels in the dome. I have no idea how to do this or what to change in the very complex Padawan 360 code. I’ve tried several solutions from the internet and asked the AI, but none of them work. Please help.
Hello.
Unfortunately, I am not very familiar with Padawan 360, so I do not have any specific suggestions. If you can explain how your system works, what you’ve tried so far, and what goes wrong, I might be able to offer some advice. However, if it is mostly a problem with using the library, you might try asking about it on the GitHub page.
Brandon
I’ve connected the first Mini Maestro, set the servo sequence, and everything works perfectly. This Maestro is located in the R2D2 body and opens the hatches, arms, etc. But I want to place a second Mini Maestro in the rotating dome. This will open and activate various servos located in the dome. I have no problems setting up the animations and know how to do it in Maestro software.
However, I don’t know what I would need to change in the Padawan code to recognize the second Mini Maestro.
Everything about the Maestro in the Padawan 360 code looks like this, in order:
#include <PololuMaestro.h> // added the Maestro libray
//#include <SoftwareSerial.h>
SoftwareSerial maestroSerial(10, 11); //tx pin 11
//MiniMaestro maestro(Serial3); //hardware serial
MiniMaestro maestrosserial(maestroSerial); //software serial
Later in the code, there’s a void setup:
void setup() {
#if FOOT_CONTROLLER == 0
Serial1.begin(SABERTOOTHBAUDRATE);
#endif
Serial2.begin(DOMEBAUDRATE);
//Serial3.begin(9600); //start serial3 for the Maestro body
maestroSerial.begin(9600);
And then there’s the configuration of the pad buttons.
There’s quite a bit of it, so I won’t paste it all, but the first line looks like this:
//Maestro stuff here
if (Xbox.getButtonPress(R2, 0)) {
if (Xbox.getButtonPress(UP, 0)) {
maestrosserial.restartScript(0);
}
}
The best way is describe Maestro Body (first one) and Maestro Dome (second one).
To communicate with multiple Maestro controllers on the same serial bus, you will need to configure them each with a unique device number. You can configure the device number for each Maestro from the “Serial Settings” tab of the Maestro Control Center software. You can find more details (including connection information) in the “Daisy Chaining” section of the Maestro user’s guide.
Once each Maestro has been configured with a unique device number and connected properly, you can use the MiniMaestro() constructor from our library to create a separate object for them in your code, making sure to specify the device number as the third argument. For example, your constructors might end up looking something like this, where deviceNumberBody and deviceNumberDome match the device numbers configured in the Maestro Control Center:
MiniMaestro bodyMaestro(maestroSerial, Maestro::noResetPin, deviceNumberBody); //constructor for Maestro in body
MiniMaestro domeMaestro(maestroSerial, Maestro::noResetPin, deviceNumberDome); //constructor for Maestro in dome
Then you can use each object name to specify which Maestro you are sending commands to (e.g. bodyMaestro.restartScript(0); to restart the Maestro in the body at subroutine 0 and domeMaestro.restartScript(0); to restart the Maestro in the head at subroutine 0).
Brandon
