I'm building a probe droid, or ID-10 seeker droid from Star Wars Battlefront 2. A bit of a preface, I'm not new to prop building, but definitely new to coding Arduino. For the last few days I've been trying to see if there were similar examples for what I wanted the droid to do, I've also watched a few hours worth of Youtube tutorials (I really liked Benduino's videos) on arduino to get a feel for the language, but it's quite overwhelming. If any of you recommend a strong set of tutorials, I'm very open to learning more.
Saying that, let me tell you what I would like to do:
Ideally the end result will do the following:
- Dome will spin randomly with a continuous servo
- Adafruit sequins lights - they don't blink in the game, so I will just power these normally
- Sound 1 - I have one track that I would like on loop as a background track - not sure how to play this without it being interrupted by other sounds - is layering sounds possible?
- Sound 2 - I have other tracks that I would like played randomly overtop the background track
- IR - I have 3 infrared sensors that I would like to trigger certain sounds and have the servo move to a certain position - so the probe droid is tracking or finding something
- Arduino Nano
- Adafruit mini Sound FX 16mb board
- Adafruit sequins (red/white)
- Adafruit MAX98306 amp
- 2x 4omh3W speakers
- High torque continuous servo
- 3x IR sensors - these were ones that I pulled from a BB8 Spinmaster toy, but if they don't work, I'm willing to replace them with proper Arduino PIR sensors. Just thought I could reuse them.
Using a Mac and Arduino IDE
I took a look at Robin's code for SeveralThingsAtTheSameTime as I figured it would be a good starting point for the project. I'm not using lights, but I thought I could just replace the naming of LED with "sound" and adjust accordingly. The biggest thing for me was trying to understand how to run the program without delays and time things properly.
The background track that I want to use is looping, but it's weird because I'm not even calling that particular pin - it's not in the loop or read function. The sound effects do not interrupt the loop.
The servo does move clockwise and counter clockwise, but I'm trying to figure out how to slow it down, and have spacing/delays between the movements - keep in mind it's a continuous servo.
I have not added the IR sensors yet. This will need to be tied in to servo movements and "possibly" some targeted sounds.