Christopher Ault
Published © GPL3+

Punk Rock Skeleton and Reaper Band motion sync

How to use Arduino to keep the Costco Punk Rocker Skeleton moving as long as the Lowes Reaper Band is playing music!

IntermediateWork in progress2 hours930
Punk Rock Skeleton and Reaper Band motion sync

Things used in this project

Story

Read more

Schematics

Wiring Diagram

Code

Arduino Code

C/C++
all the code you need for this
int analogSensorPin = A5;  
int analogSensorValue = 0;  //  the value coming from the output cable on the Reaper
int outputPin = 2;

int analogOut = 3; // use only pin 3! not 5 or 6! 

void setup() {
   pinMode(2, OUTPUT);     // output to the Punk Rocker's motion sensor port

  Serial.begin(9600);
  Serial.println("starting");
}

void loop(){
  analogSensorValue = analogRead(analogSensorPin);

// occasionally, noise on the analog input line can cause a reading higher than 0
// these readings are usually less than 20 and are very intermittent
// so, check for a higher value to prevent randomly starting the motion seequences.
// music coming from that line will average a value around 900 
  if(analogSensorValue < 200){
    Serial.println(" *** PAUSED ***");
    analogWrite(analogOut, 0);
     digitalWrite(outputPin, LOW); // tell the motion sensor port on the Punk Rocker that nothing is happening
    return;
  }else{
    Serial.println(" *** PLAYING ***");

    // the motion sensor in the Punk Rocker appears to be listening for a change in state
    // so it has get both a HIGH and LOW here in order to think motion happened and continuously play a sequence
    digitalWrite(outputPin, LOW);
    delay(1000);
    digitalWrite(outputPin, HIGH); // make the Punk Rocker think it saw motion


    analogWrite(analogOut, analogSensorValue); // send analog signal back to next Reaper Band prop
  }
   delay(500);
}

Credits

Christopher Ault

Christopher Ault

1 project • 1 follower

Comments