Tumgik
Video
undefined
tumblr
Final project light game after the classmate input 
My Finish Work
0 notes
Video
undefined
tumblr
Final project light game before the input of my classmates 
0 notes
Text
Final project light game part 3
For the case, I picked, a thin, wood material and used the laser cutter to make it. Meanwhile, I will have the top part with the LED lights and button. My measurements were off, so the sides were a little taller. I also found it harder to put it together even when using Gorilla Glue. For the wires, I made them longer, to play it safe, so I wouldn’t have trouble keeping them connected to the Arduino. When I got feedback from my classmates, I changed the code to present more interest, similar to when you hit the same LED light 3 times, and all lights will blink while keeping the speed rate a little slower than the original coding using Chat GPT.
0 notes
Text
Final project light game code
int ledPins[] = {2, 3, 4, 5, 6}; // array of LED pinsint numLeds = 5; // number of LEDsint direction = 1; // current direction of LED motionint currentLed = 0; // index of currently lit LEDbool stopped = false; // whether the LEDs are currently stoppedbool buttonPressed = false; // whether the button is currently pressedint buttonPin = 7; // pin for the stop buttonint speed = 100; // initial delay between LED changesint buttonCount = 0; // number of times button was pressed on current LEDunsigned long buttonPressStartTime = 0; // time when the button was pressed void setup() {  // set LED pins as outputs  for (int i = 0; i < numLeds; i++) {    pinMode(ledPins[i], OUTPUT);  }  // set button pin as input with pull-up resistor  pinMode(buttonPin, INPUT_PULLUP);  // turn on first LED  digitalWrite(ledPins[0], HIGH);} void loop() {  // check whether button is pressed  if (digitalRead(buttonPin) == LOW) {    if (!buttonPressed) { // button just pressed      buttonPressStartTime = millis(); // record the press start time      buttonPressed = true;    } else { // button still pressed      unsigned long currentTime = millis();      unsigned long buttonHoldDuration = currentTime - buttonPressStartTime;      if (buttonHoldDuration >= 2000) { // button held for 2 seconds        resetSpeed();      }    }  } else {    if (buttonPressed) { // button released      buttonPressed = false;      if (!stopped) { // LEDs still moving        buttonCount++; // increment button count        if (buttonCount == 3) { // button pressed 3 times          stopAndBlink();        }      }    }    if (!stopped) { // LEDs still moving      moveLEDs();    }  }} void moveLEDs() {  digitalWrite(ledPins[currentLed], LOW); // turn off current LED  currentLed += direction; // move to next LED  if (currentLed == numLeds || currentLed == -1) { // if at end of LEDs, reverse direction    direction *= -1;    currentLed += direction;  }  digitalWrite(ledPins[currentLed], HIGH); // turn on next LED  delay(speed); // delay between LED changes} void stopAndBlink() {  stopped = true; // stop the LEDs  for (int i = 0; i < 5; i++) { // blink all LEDs 5 times    for (int j = 0; j < numLeds; j++) {      digitalWrite(ledPins[j], HIGH);    }    delay(200);    for (int j = 0; j < numLeds; j++) {      digitalWrite(ledPins[j], LOW);    }    delay(200);  }  stopped = false; // resume LED motion  buttonCount = 0; // reset button count} void resetSpeed() {  speed = 100; // reset speed to its original value}
0 notes
Video
undefined
tumblr
Final project Light game
Redesign from the prototype 
Putting the wires together 
0 notes
Text
Final Project light game part 2
But problems occurred quickly, and I learned that the RGB light took almost all of the ports in the Arduino, so it was possible to have it on all sides. As a result, I used LED lights instead and connected it on top of the cases, in a row where the lights would been a loop. When every time the button was pressed it would speed up, and if you hit the right color it would blink two times to indicate that you did it correctly.
0 notes
Photo
Tumblr media
The prototype that was never meant to be 
0 notes
Text
Final project Light Game
For my final project, I wanted to have a more fun, interactive feel than my midterm, so I took inspiration from an arcade game. In this case, the silver ball hits a certain light, and goes in a loop to win the game. As a result, I selected a cube-like container that had all sides, excluding the bottom, with RGB lights.  When a button is pressed on top of the container, it will present a random color. Next, you have to match each side with the same color to win
0 notes
Video
undefined
tumblr
Midterm finish project video 
0 notes
Video
undefined
tumblr
Midterm almost done with more progress 
0 notes
Text
Midterm part 4
When the pulse sensor turned on, the two LED lights close to the pulse sensor will start to record your pulse. This is shown by how many times it turns on/off, while also bringing its brightness indicator to an increased pulse level.
0 notes
Text
Midterm the code
int ledPin1 = 9;int ledPin2 = 10;int sensorPin1 = A0;int sensorPin2 = A1;int sensorValue1;int sensorValue2;int pwmValue1;int pwmValue2; void setup() {  pinMode(ledPin1, OUTPUT);  pinMode(ledPin2, OUTPUT);  Serial.begin(9600);} void loop() {  sensorValue1 = analogRead(sensorPin1); // read the first sensor value  sensorValue2 = analogRead(sensorPin2); // read the second sensor value  pwmValue1 = map(sensorValue1, 400, 700, 0, 255); // map the first sensor value to PWM value (0-255)  pwmValue2 = map(sensorValue2, 400, 700, 0, 255); // map the second sensor value to PWM value (0-255)  analogWrite(ledPin1, pwmValue1); // set the first LED brightness according to the first PWM value  analogWrite(ledPin2, pwmValue2); // set the second LED brightness according to the second PWM value  delay(10); // small delay for stability  Serial.print(sensorValue1); // print the first sensor value for debugging  Serial.print(" ");  Serial.print(sensorValue2); // print the second sensor value for debugging  Serial.println();}
0 notes
Text
Midterm part 3
So when using Chat GPT for the code, I needed a few attempts to make the coding right. This is because the wording has to be accurate enough to make my project run properly.
0 notes
Text
Midterm part 2
There were some difficulties that I had encountered at first. I needed to buy a few extra items for this project, including a case hold (the Arduino) and the wires, but I also encountered some other concerns. One of them was making a hole for the wire to connect to the computer without using a power tool. I had only a knife and screwdriver. In addition, I needed to buy an extra pulse sensor to observe the differences while using my project. But the most challenging task was getting the top cover, and the wires for the LED lights and pulse sensor to fit into the holes and not disconnect from the bread board. I hadn’t realized my wires were too short, and this presented more difficulties.
0 notes
Video
undefined
tumblr
me putting the wires together working on the midterm 
0 notes
Photo
Tumblr media
the diagram for midterm project 
0 notes
Text
Midterm
For my midterm project, I wanted to use pulse sensor to control LED lights that would respond to our individual pulses. This would be with the help of Chat GPT, using its AI coding to make my project perform successfully.
0 notes