top of page

WORK1.愿望之盒

TIME:2020/10/15

BACKGROUND.

快乐星球就是为了给世界传递快乐的理念。每个人都有自己的丰富多彩的愿望,如果可以梦想成真的话,那该多好!但是,真有美梦成真这样的好事吗?

The aim of The Happy planet is to convey the idea of happiness to the world. Everyone has his own rich and colorful wishes, if only the dream could come true! But is there such a good thing as a dream come true?

​比如,对阿拉丁神灯许愿,就能实现三个愿望……

For example, if you wish on Aladdin's lamp, you can realize three wishes……

 

 

 

 

 

​所以,由于球民们的热烈期盼,有一天快乐星球上突然掉落了一个愿望之盒?!

Therefore, due to the ardent expectations of the golfers, a wish box suddenly fell on the happy planet?!

u=1557429557,1253239685&fm=26&gp=0.jpg

THOUGHTS.

向愿望之盒许愿,打开盒子,就能发现盒子里的小惊喜,但是当你想去拿出惊喜时,盒子又关上了,就像是一个触不可及的梦。

Make a wish to the wish box, open the box, you can find the small surprise in the box, but when you want to take out the surprise, the box is closed again, just like a dream out of reach.

bb6b75c211b77141879faafa7982cee.jpg

ARDUINO CODE.

#include <Servo.h>   
Servo servo;
int servoPin = 9;
int trigPin = 6;    
int echoPin = 7;  

long duration, distance;   

int Button = 4;
boolean ButtonState = 1;

void setup() {     
  servo.attach(servoPin);  //连接舵机
  pinMode(trigPin, OUTPUT);  //定义输出引脚
  pinMode(echoPin, INPUT);  //定义输入引脚
  servo.write(0);  //设定引脚转动角度,这里是初始角度
  delay(1000);
  servo.detach();  //使舵机与其接口分离
  
  pinMode(Button, INPUT);  //定义按钮为输入
}

void measure() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW); //前面5句都是发射脉冲信号
  pinMode(echoPin, INPUT);  //定义输入引脚
  duration = pulseIn(echoPin, HIGH);  //检测引脚输出的高低电平的脉冲宽度
  distance = duration *0.034 / 2;  //测出距离
}

void loop() { 
  measure();
  if (digitalRead(Button) == HIGH){
    servo.attach(servoPin);
    delay(1);
    servo.write(90);   
    delay(1000);
    servo.detach();      
  }
if (distance<40) {
    servo.attach(servoPin);
    delay(1);
    servo.write(0);  
    delay(1000);
    servo.detach();      
  }

}

implementation technology.

ARDUINO.
 

017c27ead026e63eda7f1ba16415f74.png

VIDEO.

Please enjoy it!

Behind the scenes.

Production process display.

1/ PHOTOS

ac3d74027c9e147bbd6931a81bc4934.jpg
437498b7f2929721e2bcf6517ac804c.jpg
68d4161084bbfc23067c90e670f2020.jpg
fd2d702f6e05abb6318a17f9ff4e635.jpg
eebc3aaffb9d6412080c748c1f10f75.jpg
df27ccc41e239a07bb4625ba71ac5c5.jpg
9ed624ba9a8141b3555bd52b10fa2da.jpg
bedc9abceef16fea176097cdf083907.jpg

2/ VIDEOS

bottom of page