Coral Lamp
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
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
Cut the bottles into strip, and bake it in the oven. Then attach them with glue gun.