Thursday, January 19, 2023

My zombie "interactive" LED lights

 Hi again!

So I struggled A LOT and am still confused about why I can’t get this thing to work. It is not interactive yet, looks more like an artifact representing my failure. Here is two different photos with two different attempts that ended up not working unfortunately. 

First attempt:


Second attempt:


I am currently working on the third attempt and when it is finished I will post the final code here as well (can’t wait) 

3RD UPDATE: 

I GOT SOMETHING WORKING, it is not a 100 percent yet but I am pretty proud so far.

video:




Code so far:

  // serial communication
  Serial.begin(9600);

  //LED pins
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
 
  //button
  pinMode(13, INPUT);
  // pin 13 resistor
  digitalWrite(13, HIGH);
}

void loop() {

 


  //is button being pressed?
  if (digitalRead(13) == 0) {

   
    digitalWrite(9, HIGH);
   
   
  } else {
    //2nd
    if (analogRead(A0) <= 700) {

      digitalWrite(8, HIGH);
     
      digitalWrite(10, HIGH);
     
    }
   
    //3
     if (analogRead(A0) >= 0 && analogRead(A0) <= 240) {
   
      digitalWrite(8, LOW);
      digitalWrite(9, LOW);
      digitalWrite(10, LOW);
     
   
    }
    //reading of button and pot
    Serial.print(analogRead(A0));
    Serial.print("  ");
    Serial.println(digitalRead(13));
  }
}



No comments:

Post a Comment

Input/Output 2: Touch designer progress demo

  Hi again, This is a little someting something I made Touch Designer progress:  This week, I created a (demo) moving liquid situation on to...