Intergrating the Zumo and Project Sentry Gun code

As the topic indicates I want to integrate the two codes together the Maze and PSG code for my mount which is a small tilt and pan servo setup with a class 1 laser as a firing solution. The problem I am seeing is that the program will not run as one and requirers the PSG to be loaded once the sumo has finished the maze course, which I don’t want to do.

The PSG code is from

Also my end of Maze graphic which is a 11 * 6cm box or circle is causing the sumo to kink (drive to the left) at the end and not end up straight as expected any ideas on a fix should it just be a straight line?

I have both codes working separately but want it to run together is this possible? I know there is code to run 1 servo but is there a way to run 2? is it a matter of ok I have finished with the sumo code now onto the PSG code is it that easy?



Which Arduino are you using? If you are using an Arduino Leonardo, you should be able to control multiple servos easily by modifying the Arduino Servo library to use Timer 3 instead of Timer 1. If you are using an Arduino Uno, you might be able to modify the code for controlling a servo found in the Zumo Shield User’s Guide to accommodate two servos. If you do try modifying it and run into issues, you could post what you have, and I would be happy to take a look at it.

Alternatively, you might consider using a separate controller to move the servos. Our Maestro servo controllers might work for your application. You could have the Arduino on the Zumo Shield send serial commands to the Maestro to control the servos.

- Jeremy