My project is that I am building an animated (singing, dancing, head turning, and arm waving) snowman.
I have 3 DC motors for individual functions that are to be run via Arduino Adafruit V1 card programming. Motor #1 will control head turning, motor #2 will control arm waving, and motor #3 will control upper torso dancing. The movements will occur both individually and simultaneously at times throughout the time cycle (2 minutes and 45 seconds).
I need figuring out how to program my card to synchronize the motors to the movements and timeframes. I am an amateur at this and have never coded anything before this project.
The following is a segment of what my coding needs look like:
When the cycle begins the snowman‘s head (motor 1) will turn slowly to the right for two seconds, then turn left for two seconds (as it returns to center), pauses for 3 seconds, and then turns to the left for 2 seconds, then to right for two seconds (returning to center again). (This is the 11 second mark of the 2 minute and 45 second time cycle; and head stays still until at the 21 second mark it turns right for two seconds and then immediately left for two seconds. (Now at the 25 second mark.) It then pauses until the 33 second mark when it will turn again (*subsequent head turn times).
Simultaneously when the cycle begins, the arm (motor 2) begins waving. This motor will spin slowly to the right for 2 seconds, pause for 9 seconds, and turns left for 2 seconds again (to return to starting position). Then motor 2 will continuously turn right for 2 seconds and then left for 2 seconds (for continuous arm waving) until it reaches 33 second mark (of the 2 minute and 45 second time cycle). This motor/arm then pauses until it will turn again (*subsequent arm waving times).
At the 11 second mark (of the 2 minute and 45 second time cycle), motor 3 will turn on continuously to the right for 22 seconds (moving the snowman’s torso in dancing motion). It then pauses at this 33 second mark until it will turn again (*subsequent motor 3/dancing times).
- At the 33 second mark, the first song ends and a new one subsequently begins, and with this the three motors resume their functions at specific times (similar to above synchronization) that need to be written out/programmed like above.