eyeMask

My originally idea was to make a eye mask for my trip in airplane or train. When I nearly finished my wife suddenly found it was very suitable for me when I sat on the beach. So it gave me inspiration.

We made the lens as heart shape.  If I laid down the mask would be on. So I could hide myself from the sunshine. If I sat up the mask would be off. So it wouldn’t bother me for enjoying bikini girls ;-D

IMG_1337 IMG_1336

The code is here,

 

#include <Servo.h>

Servo myservo;

int switchPin = 3; // tilt sensor input to 3
int val; // the tilt value, 0 or 1

void setup()
{
myservo.attach(9);
pinMode(switchPin, INPUT);
Serial.begin(9600);
}

void loop()
{
val = digitalRead(switchPin);
Serial.println(val);

if (val == 1){
myservo.write(90);
delay(15);
}
if (val == 0){
myservo.write(180);
}
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *