# Coral Lamp

14

## Introduction: 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

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 2: 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 } }

## Step 3: Plastic Coral

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

19 2.2K
2 224
18 2.0K