Interactive Cloud Project

For my interactive Project I decided to make a Led Storm Cloud. The cloud would light up and blink based on what code you programmed it to do. In this Project, My cloud lights up rainbow colors and blinks as if an actual storm cloud would using the Delay command.

Materials:

2 packs of cotton balls

Hot Glue Gun

Led strip lights

Empty Bottle of water

Ardiuno

Step 1: Glue cotton balls onto Empty bottle of water

Step 2: Connect Led Strip lights to Arduino and place led lights in bottle

Step 3: Program code of your choice

Code:

#include <Adafruit_CircuitPlayground.h>
// do NOT include the standard NeoPixel library

#define NEOPIX_PIN A2
#define NUM_PIXELS 30

// use Adafruit_CPlay_NeoPixel to create a separate external NeoPixel strip
Adafruit_CPlay_NeoPixel strip = Adafruit_CPlay_NeoPixel(NUM_PIXELS, NEOPIX_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
// initialize the Circuit Playground as usual
// this will initialize the onboard NeoPixels as well
CircuitPlayground.begin();

// initialize external NeoPixel strip separately
strip.begin();
}

void loop() {
// for the on board NeoPixels, use the CircuitPlayground functions
CircuitPlayground.clearPixels();

// for the external NeoPixels, must use the Adafruit_CPlay_NeoPixel functions directly
strip.clear();
strip.show();

delay(100);

CircuitPlayground.setPixelColor(0, 255, 0, 0);
CircuitPlayground.setPixelColor(1, 128, 128, 0);
CircuitPlayground.setPixelColor(2, 0, 255, 0);
CircuitPlayground.setPixelColor(3, 0, 128, 128);
CircuitPlayground.setPixelColor(4, 0, 0, 255);
CircuitPlayground.setPixelColor(6, 255, 0, 0);
CircuitPlayground.setPixelColor(7, 128, 128, 0);
CircuitPlayground.setPixelColor(8, 0, 255, 0);
CircuitPlayground.setPixelColor(9, 0, 128, 128);
CircuitPlayground.setPixelColor(10, 0, 0, 255);

CircuitPlayground.setPixelColor(5, 0xFF0000);
CircuitPlayground.setPixelColor(6, 0x808000);
CircuitPlayground.setPixelColor(7, 0x00FF00);
CircuitPlayground.setPixelColor(8, 0x008080);
CircuitPlayground.setPixelColor(9, 0x0000FF);
CircuitPlayground.setPixelColor(10, 0xFF0000);
CircuitPlayground.setPixelColor(11, 0x808000);
CircuitPlayground.setPixelColor(12, 0x00FF00);
CircuitPlayground.setPixelColor(13, 0x008080);
CircuitPlayground.setPixelColor(14, 0x0000FF);

// some functions are the same
strip.setPixelColor(0, 255, 0, 0);
strip.setPixelColor(1, 128, 128, 0);
strip.setPixelColor(2, 0, 255, 0);
strip.setPixelColor(3, 0, 128, 128);
strip.setPixelColor(4, 0, 0, 255);
strip.setPixelColor(5, 255, 0, 0);
strip.setPixelColor(6, 128, 128, 0);
strip.setPixelColor(7, 0, 255, 0);
strip.setPixelColor(8, 0, 128, 128);
strip.setPixelColor(9, 0, 0, 255);
strip.setPixelColor(10, 255, 0, 0);
strip.setPixelColor(11, 128, 128, 0);
strip.setPixelColor(12, 0, 255, 0);
strip.setPixelColor(13, 0, 128, 128);
strip.setPixelColor(14, 0, 0, 255);
strip.setPixelColor(15, 255, 0, 0);
strip.setPixelColor(16, 128, 128, 0);
strip.setPixelColor(17, 0, 255, 0);
strip.setPixelColor(18, 0, 128, 128);
strip.setPixelColor(19, 0, 0, 255);
strip.setPixelColor(20, 255, 0, 0);
strip.setPixelColor(21, 128, 128, 0);
strip.setPixelColor(22, 0, 255, 0);
strip.setPixelColor(23, 0, 128, 128);
strip.setPixelColor(24, 0, 0, 255);
strip.setPixelColor(25, 255, 0, 0);
strip.setPixelColor(26, 128, 128, 0);
strip.setPixelColor(27, 0, 255, 0);
strip.setPixelColor(28, 0, 128, 128);
strip.setPixelColor(29, 0, 0, 255);
strip.setPixelColor(30, 0, 0, 255);
// but for the external strip, must call show()
strip.show();

delay(1000);
}