Hi,
I am totally new to Maestro, but so far very impressed.
I’ve just managed to connect my Arduino to one Maestro. Currently the Arduino code reads the state of one button and then runs the script of the Maestro, while another button stops it.
[code]#include <PololuMaestro.h>
#ifdef SERIAL_PORT_HARDWARE_OPEN
#define maestroSerial SERIAL_PORT_HARDWARE_OPEN
#else
#include <SoftwareSerial.h>
SoftwareSerial maestroSerial(10, 11);
#endif
MicroMaestro maestro(maestroSerial);
const int buttonPin1 = A0;
const int buttonPin2 = A1;
int buttonState1 = 0;
int buttonState2 = 0;
void setup()
{
maestroSerial.begin(9600);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
}
void loop()
{
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
if (buttonState1 == HIGH) {
maestro.restartScript(0);
}
if (buttonState2 == HIGH) {
maestro.stopScript();
}
}
[/code]
NOW, I would like to press those same buttons and run/stop the scripts of about 10 Maestro’s. I have gathered that daisy chaining the Maestro’s to the Arduino might be the best option. However, the Arduino code that then controls those actions are completely eluding me.
- What do I need to add to the above code to make those buttons run/stop the scripts of several daisy chained Maestro’s?
- Is there anything that will need to happen on the Maestro side? Do I first load the script that is associated to each Maestro onto each of them separately and then daisy chain them? Or how does this work?
I just need the simplest and most efficient way to control the playback of ‘recorded’ sequences that have been copied to the script of several Maestro’s via one Arduino.
Thanks for all the help so far!
Best
Nelmarie