Devices & Components
Arduino Uno Rev3
Hardware & Tools
Premium Male/Male Jumper Wires, 40 x 3" (75mm)
Jumper wires (Male to Female)
Software & Tools
Custom app
Project description
Code
Code
cpp
all the code you need
1int analogSensorPin = A5; 2int analogSensorValue = 0; // variable to store the value coming from the sensor 3int sensorValue2 = 0; 4int outputPin = 2; 5 6int analogOut = 3; // use only 3! not 5 or 6! 7 8void setup() { 9 pinMode(2, OUTPUT); // declare sensor as input 10 11 Serial.begin(9600); 12 Serial.println("starting"); 13} 14 15void loop(){ 16 analogSensorValue = analogRead(analogSensorPin); 17 18 19 if(analogSensorValue == 0){ // paused 20 Serial.println(" *** PAUSED ***"); 21 analogWrite(analogOut, 0); 22 return; 23 }else{ 24 Serial.println(" *** PLAYING ***"); 25 digitalWrite(outputPin, LOW); 26 analogWrite(3, 100); 27 delay(1000); 28 digitalWrite(outputPin, HIGH); 29 analogWrite(analogOut, analogSensorValue); // send signal back to next Reaper Band prop 30 } 31 delay(500); 32 33}
Downloadable files
Wiring Diagram
Wiring Diagram
wiring diagram.png

Comments
Only logged in users can leave comments