Coral Lamp

by Jasmine_Hsu in Circuits > Arduino

152 Views, 0 Favorites, 0 Comments

Coral Lamp

IMG-1842.JPG
IMG-1923.JPG
IMG-1924.JPG

I love the ocean. But now, people are polluting it, and I want to figure out a way to reuse wastes that would harm the Earth.

Supplies

Arduino Leonardo*1, LED*6, button*1, resistance*7, lots of wires, plastic bottles, glue gun, box, box cutter

Set Up the Circuit

螢幕快照 2019-12-17 下午7.55.22.png

Coding

void setup(){ // put your setup code here, to run once:

pinMode( 10 , INPUT); // sets the digital pin as input pinMode( 13 , OUTPUT); // sets the digital pin as output pinMode( 12 , OUTPUT); // sets the digital pin as output pinMode( 11 , OUTPUT); // sets the digital pin as output pinMode( 9 , OUTPUT); // sets the digital pin as output pinMode( 8 , OUTPUT); // sets the digital pin as output pinMode( 7 , OUTPUT); // sets the digital pin as output }

void loop(){ // put your main code here, to run repeatedly: if (digitalRead( 10 )) { digitalWrite( 13 , HIGH ); // sets the digital pin on/off digitalWrite( 12 , HIGH ); // sets the digital pin on/off digitalWrite( 11 , HIGH ); // sets the digital pin on/off digitalWrite( 9 , HIGH ); // sets the digital pin on/off digitalWrite( 8 , HIGH ); // sets the digital pin on/off digitalWrite( 7 , HIGH ); // sets the digital pin on/off } if (digitalRead( 10 )) { digitalWrite( 13 , LOW ); // sets the digital pin on/off digitalWrite( 12 , LOW ); // sets the digital pin on/off digitalWrite( 11 , LOW ); // sets the digital pin on/off digitalWrite( 9 , LOW ); // sets the digital pin on/off digitalWrite( 8 , LOW ); // sets the digital pin on/off digitalWrite( 7 , LOW ); // sets the digital pin on/off } }

Plastic Coral

IMG-1916.JPG

Cut the bottles into strip, and bake it in the oven. Then attach them with glue gun.

Paint the Box

IMG-1921.JPG

Seal Your Box With Glue Gun

Enjoy Your Time With It :)

IMG-1922.JPG