STUPID PET TRICK
Code:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(analogRead(A1)<200){
digitalWrite(9,HIGH);
digitalWrite(10, LOW);
}
if(analogRead(A1)>200&analogRe ad(A1)<800){
digitalWrite(9,LOW);
digitalWrite(10, LOW);
}
if(analogRead(A1)>800&analogRe ad(A1)<1000){
digitalWrite(9,LOW);
digitalWrite(10, HIGH);
}
}
This project is a device that controls the left and right LED switches through a variable resistor. By rotating the male figure in the middle, when he faces the female figure on the left or right, it can make the heart shape under the box light up.
The problem I'm having is how to hide my circuit and how to link the male doll to the variable resistor. In this regard, my solution is to use cardboard to only make a box to hide the circuit, and I use a straw as a tool to link the male doll and the variable resistor.
评论
发表评论