Computer 1
Computer 1
🔑Key points:
1.air pump
Our studio provides air pumps and tubes, but we looked through most of the Arduino air pump tutorials on the Internet and found that we were missing an electronic switch to turn 3 ends into 2 ends. So we bought three on Taobao, and also bought the "best to have" air pump expansion board.
Wrong expansion board we've tried
The switch we needed
When we used the expansion board, something went wrong.
After we asked Taobao customer service, they said that the additional power supply must be connected to the expansion board because the Arduino board will limit the voltage, but once we connected other electronic components to this board, the whole system would immediately lose power and the computer interface would be unusable for a while. We guessed that the Mac had turned on the short-circuit protection.
But we can't do without an extended power supply, because we still have two LEDs, so we modified the legs of the air pump and removed the extended board. 🔽
At the same time, we also found that the three-way two-end solenoid valve in studio looked different from the one on the Internet. After several attempts that almost damaged the air pump, we found that it should be connected like this:
At the same time, make sure the balloon has been blown up in advance, because the air pump does not have that much power, and then tie the joints with rubber bands.
We originally had a step where each LED jumped from 20 pits to 60 pits, and a small red LED would light up, but when we wanted to stuff them into the balloon, we found that this would definitely cause the balloon to leak. Once there is a little gap, the balloon will not work. So we removed this part.
Then it works! ➡️
2.Pulsing LED
Variables:
brightness1: Tracks the current brightness level.
fadeAmount1: The step size for brightness change (positive or negative).
interval1: Controls the time delay between each brightness update (slows down or speeds up pulsing).
Logic:
Adjust brightness1 using fadeAmount1.
Reverse the direction when brightness1 hits max (255) or min (0).
Use millis() to control when the brightness is updated (non-blocking delay).
*3.BGM from Mouthwashing soundtrack: https://youtu.be/H-SLiGbn3aM?si=PzS5RSh5vzo-ihsz
soundbg = new SoundFile(this, "bg.mp3");
soundbg.amp(0.3); // Set music volume
soundbg.loop();
We got our art inspiration from this game.
4.Processing canvas
Dynamic gradient background:
A gradient background is formed by a rectangle with a blue hue, and the rectangle moves upward at a certain speed (squareY -= 2).
When the rectangle moves out of the screen, the position is reset (squareY = 0).
Use a for loop to draw a grid and control the color gradient of each rectangle (map() function).
Color: float gradient = map(yPos, 0, height, 50, 200); fill(0, 0, gradient);
UI part:
Text input box:
Use rect() to draw the input box.
The input text is displayed in the input box in real time (inputText).
The text size is associated with the height of the input box to avoid incomplete display.
Submit button:
The button position is dynamically calculated by calculateSizes() to ensure adaptation to different screen resolutions.
When clicking, detect whether the mouse position is in the button area (detected in mousePressed()).