How to Make a Lightning Cloud

73,975

877

87

Intro: How to Make a Lightning Cloud

I really wanted to make a little cloud that would light up as though it was filled with lightning. After googling a bit, I stumbled upon "The Cloud" by Richard Clarkson. It's a beautifully executed concept and I wanted to see if I could make one too. There are lotsofexamples of "cloud lamps." What I like about mine is I built the shape of the cloud completely from scratch, so I wasn't left with a mostly round cloud (a common problem). I'm also really proud of the lightning animation I created.

This is the first of three steps. The second part of this project will be adding bluetooth control, so I can trigger weather patterns in the cloud via my phone. The third part will be automatically triggering weather patterns according to the day's weather report. I want an easy-to-use, "glanceable," aesthetically appealing weather indicator for my apartment. Plus I've heard cloud computing is the hot new thing.... :)

Stay tuned for those future Instructables!

Step 1: Gather Materials

1. Cardboard

2. Cotton balls

3. Polyester batting, 3/4" thick. It's easiest to pick out batting by going to a fabric store in person to find the right kind. You want batting that's about an inch thick. Something like this, but I'd need to see it in person to know if it was the right thickness. If you go to a fabric store, they'll let you cut a smaller amount. It should be about $6.99 per yard. I used about 2 square feet.

4. Boning (like the kind used for corsets). I used a yard and could have found use for more.

5. Needle and thread

6. Hot glue gun

7. Adafruit Neopixel LEDs. I used these "Breadboard friendly" ones. You can also buy them in packs of 4.

8. Wire

9. Soldering iron

10. Microcontroller (I used an Adafruit Pro Trinket with the little battery backpack soldered on)

11. Sewing pins

Step 2: Build Cloud Structure

Using a piece of cardboard for the base, glue the boning to make the basic outline of your cloud. You can make hoops with the boning - I found it was easiest to sew the two ends of the boning together, and then glue the hoop directly onto the cardboard. I also tried leaving one piece of boning pointing out into the air like ribs. Both methods worked fine.

Rip your 3/4" batting in half, and hot glue it to the boning and the cardboard in tasteful, cloud-like folds. At some points, it will be easier to gently sew the batting to the boning to keep it in place. Keep in mind how many lumps you want your cloud to have, and the overall structure. You can augment later with cotton balls, but this part will define the overall shape of your cloud.

Be sure to leave a little door in half of the cloud, where you'll place the electronics. Make the part of the batting that will become the door a little thicker than you might otherwise. It's nice to have the extra support.

Step 3: Add Fluff Texture

Gently pull apart your cottonballs. I pulled apart about 30 while my hot glue gun was heating up. The cottonballs themselves have a bit of a circular structure to them, and if you tear them apart carefully you'll preserve some of those whorls, which looks really cool later when the light shines through. You can also unroll cottonballs so they'll make longer, stringier clouds if you want.

Drip hot glue directly onto the outside of the batting, and gently pat your cottonballs into place. You don't need to completely cover the batting. Since the batting is white and a little fluffy, if some is showing that's ok. I preferred to vary the amount of cottonballs I was using so the cloud would be differing densities - it's nice if the light can shine through more in some places and less in others.

Step 4: Add Electronics

First, you'll need to solder your LEDs into a long strand. I usually
take the easiest route of soldering male-male jumper cables directly to the Neopixels. The wires are flexible, the connections are solid, and it's super fast and easy. No need to strip any wires! Test your connections as you go, so you can quickly fix any issues. The basic circuit for this project is very simple. I'm building mine on a breadboard for now, but for a more permanent project, you'll probably want to solder things together directly, or maybe use a little proto board. With only 5 LEDs, you probably don't need a capacitor, but I always throw one in anyway to be safe. The polarity of a capacitor matters. That means you need to plug it in correctly for it to work. There are several ways to recognize the polarity of your capacitor.

  • Look at the legs
    • Most capacitors will have legs with different lengths. The short leg is the negative side.
  • Look for a stripe or an arrow.
    • Most capacitors will have a light stripe down one side. That's the negative side of the capacitor

The negative side should be connected to GND. The other side attaches to PWR.

Connect power, ground, and signal from your microcontroller to your LED strand:

Arduino -------> Neopixel strand pin

#4 -------> Data Input pin

BAT+ --------> VIN

GND ---------> GND

As always, if you are new to soldering, I highly recommend Adafruit's Guide to Excellent Soldering.

Step 5: Upload the Code

Getting accurate lightning animation was super important to me for this project. I played around with lots of ideas before going with hand-picked data points and a simple moving average smoothing algorithm. I'm pretty excited about how it turned out!

https://github.com/molecule/cloud-lightning/tree/v...

You might need to update these two variables to match your setup:

https://github.com/molecule/cloud-lightning/blob/v...

You can also change these variables to make lightning strikes more or less likely:

https://github.com/molecule/cloud-lightning/blob/v...

Step 6: Put Everything Together

You can try different placements of the LEDs inside the cloud. I ended up adding some cardboard pieces on the inside, because I wanted some parts of the cloud to be a bit darker than other parts. I also left the animation playing for a while, and glued on a few more cottonballs wherever it felt right.

I wanted to be able to access the microcontroller, so I just temporarily hold the door closed with a pin through several layers of batting.

Make It Glow! Contest

Third Prize in the
Make It Glow! Contest

Halloween Decor Contest 2015

Runner Up in the
Halloween Decor Contest 2015

8 People Made This Project!

Recommendations

  • Furniture Contest 2018

    Furniture Contest 2018
  • Fix It! Contest

    Fix It! Contest
  • Tiny Home Contest

    Tiny Home Contest

87 Discussions

0
None
johnriederer

11 months ago

I need help getting the program to load to my trinket Pro. I can load the "Blink" but when I try to load Cloud-Lightning I'm getting an error. "exit status 1 Error compiling for board Pro Trinket 3V/12MHz (USB)

What am I doing wrong?

9 replies
0
None
molecule13johnriederer

Reply 11 months ago

Hmm, well you're getting a compile error (I can tell because the message you helpfully provided says "Error compiling for board"). That means that, as the compiler is trying to make the code into machine-understandable language, something went wrong. To understand what, we need more information! First, turn on the verbose messages for compiling in your IDE:

File->Preferences->Show verbose output during:. Tick boxes for compilation and upload.

Then try to compile again. You should get a LOT more information, and some of it will be useful :) In particular, I'm guessing you're missing one of the libraries you need to install (or you didn't restart the IDE after installing them). But we should be able to tell with more information.

0
None
johnriederermolecule13

Reply 11 months ago

Here is the full verbose compilation Thanks for the Help

Arduino: 1.8.3 (Windows 10), Board: "Pro Trinket
3V/12MHz (USB)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs
-logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware
C:\Users\John\AppData\Local\Arduino15\packages -tools C:\Program Files
(x86)\Arduino\tools-builder -tools C:\Program Files
(x86)\Arduino\hardware\tools\avr -tools C:\Users\John\AppData\Local\Arduino15\packages
-built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries
C:\Users\John\Documents\Arduino\libraries -fqbn=adafruit:avr:protrinket3
-ide-version=10803 -build-path C:\Users\John\AppData\Local\Temp\arduino_build_269669
-warnings=none -build-cache
C:\Users\John\AppData\Local\Temp\arduino_cache_672861
-prefs=build.warn_data_percentage=75
-prefs=runtime.tools.avrdude.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9
-prefs=runtime.tools.arduinoOTA.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1
-prefs=runtime.tools.avr-gcc.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2
-verbose C:\Users\John\Desktop\Lightning\cloud-lightning\cloud-lightning.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile
-logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware
C:\Users\John\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder
-tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools
C:\Users\John\AppData\Local\Arduino15\packages -built-in-libraries C:\Program
Files (x86)\Arduino\libraries -libraries
C:\Users\John\Documents\Arduino\libraries -fqbn=adafruit:avr:protrinket3
-ide-version=10803 -build-path
C:\Users\John\AppData\Local\Temp\arduino_build_269669 -warnings=none
-build-cache C:\Users\John\AppData\Local\Temp\arduino_cache_672861
-prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9
-prefs=runtime.tools.arduinoOTA.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1
-prefs=runtime.tools.avr-gcc.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2
-verbose C:\Users\John\Desktop\Lightning\cloud-lightning\cloud-lightning.ino

Using board 'protrinket3' from platform in folder:
C:\Users\John\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9

Using core 'arduino' from platform in folder:
C:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20

Detecting libraries used...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++"
-c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections
-fdata-sections -fno-threadsafe-statics
-flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803
-DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR
"-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino"
"-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs"
"C:\Users\John\AppData\Local\Temp\arduino_build_269669\sketch\cloud-lightning.ino.cpp"
-o "nul"

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++"
-c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections
-fdata-sections -fno-threadsafe-statics
-flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L
-DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino"
"-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs"
"C:\Users\John\AppData\Local\Temp\arduino_build_269669\sketch\cloud-lightning.ino.cpp"
-o "C:\Users\John\AppData\Local\Temp\arduino_build_269669\preproc\ctags_target_for_gcc_minus_e.cpp"

C:\Users\John\Desktop\Lightning\cloud-lightning\cloud-lightning.ino:31:31:
fatal error: Adafruit_NeoPixel.h: No such file or directory

#include
<Adafruit_NeoPixel.h>

^

compilation terminated.

exit status 1

Error compiling for board Pro Trinket 3V/12MHz (USB).

0
None
molecule13johnriederer

Reply 11 months ago

Excellent! This is everything we need to figure this out. Typically, for compile errors, you want to look at the "first" error. Arduino helpfully puts that at the very end of the compile error, and I've copied it here for convenience:

fatal error: Adafruit_NeoPixel.h: No such file or directory

That basically means that you haven't installed or successfully set up the Neopixel library! So Arduino has no idea where that code is. The good news is, it's super easy to fix this. Head on over to Adafruit's excellent (as always) tutorial on installing the Neopixel library and you should be able to get past this error! Here's the link:

https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation

0
None
johnriederermolecule13

Reply 11 months ago

Thanks but now I get this error:

Arduino: 1.8.3 (Windows 10), Board: "Pro Trinket 3V/12MHz (USB)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\John\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\John\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\John\Documents\Arduino\libraries -fqbn=adafruit:avr:protrinket3 -ide-version=10803 -build-path C:\Users\John\AppData\Local\Temp\arduino_build_745192 -warnings=none -build-cache C:\Users\John\AppData\Local\Temp\arduino_cache_742529 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.arduinoOTA.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avr-gcc.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning\cloud-lightning.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\John\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\John\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\John\Documents\Arduino\libraries -fqbn=adafruit:avr:protrinket3 -ide-version=10803 -build-path C:\Users\John\AppData\Local\Temp\arduino_build_745192 -warnings=none -build-cache C:\Users\John\AppData\Local\Temp\arduino_cache_742529 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.arduinoOTA.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avr-gcc.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning\cloud-lightning.ino

Using board 'protrinket3' from platform in folder: C:\Users\John\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9

Using core 'arduino' from platform in folder: C:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20

Detecting libraries used...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "C:\Users\John\AppData\Local\Temp\arduino_build_745192\sketch\cloud-lightning.ino.cpp" -o "nul"

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\AppData\Local\Temp\arduino_build_745192\sketch\cloud-lightning.ino.cpp" -o "nul"

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp" -o "nul"

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel\esp8266.c" -o "nul"

Generating function prototypes...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\AppData\Local\Temp\arduino_build_745192\sketch\cloud-lightning.ino.cpp" -o "C:\Users\John\AppData\Local\Temp\arduino_build_745192\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\John\AppData\Local\Temp\arduino_build_745192\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10803 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\AppData\Local\Temp\arduino_build_745192\sketch\cloud-lightning.ino.cpp" -o "C:\Users\John\AppData\Local\Temp\arduino_build_745192\sketch\cloud-lightning.ino.cpp.o"

C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning\cloud-lightning.ino: In function 'void setup()':

cloud-lightning:85: error: 'simple_moving_average' was not declared in this scope

functionPtrs[0] = simple_moving_average;

^

cloud-lightning:86: error: 'random_moving_average' was not declared in this scope

functionPtrs[1] = random_moving_average;

^

C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning\cloud-lightning.ino: At global scope:

cloud-lightning:127: error: expected unqualified-id before ')' token

})

^

Using library Adafruit_NeoPixel at version 1.1.2 in folder: C:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel

exit status 1

'simple_moving_average' was not declared in this scope

Invalid library found in C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning: C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning

Invalid library found in C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning: C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning

0
None
molecule13johnriederer

Reply 11 months ago

The three most important errors are shown at the bottom again, just like last time:

C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning\cloud-lightning.ino: In function 'void setup()':

cloud-lightning:85: error: 'simple_moving_average' was not declared in this scope

functionPtrs[0] = simple_moving_average;

^

cloud-lightning:86: error: 'random_moving_average' was not declared in this scope

functionPtrs[1] = random_moving_average;

^

C:\Program Files (x86)\Arduino\libraries\Cloud-Lightning\cloud-lightning.ino: At global scope:

cloud-lightning:127: error: expected unqualified-id before ')' token

})

Those look.....strange. I encourage you to download the code again from my github account: this looks like a copy-and-paste problem.

You're also getting complaints from the IDE about your file structure. It looks like you have a folder called "Cloud-Lightning" in the Arduino/libraries folder. I am assuming Cloud-Lightning refers to the code for this project, in which case the "libraries" folder is not the right place for it! Move it up one level so it's just in the "Arduino" folder.

0
None
johnriederermolecule13

Reply 11 months ago

OK I think that the code loaded. It's not turning on the LED. I only have one connected right now. Two more questions:(for now) How do I know that it loaded correct and if I have the LED connected to Batt, 0 and Pin 4 is that correct? When "verify code after upload" is turned on I do see errors.

0
None
molecule13johnriederer

Reply 10 months ago

1. To know that it is uploaded correctly, you should see this message at the bottom of the print outs of your Arduino IDE: https://www.dropbox.com/s/hs6hnvu6xhmmn0p/Screensh...
If you don't see that confirmation message, you might not have uploaded successfully! But remember, I can't help you if you don't post the error messages you're getting...so if you want help, be sure to always include all the information! Also tell me what kind of Arduino board you're using.

2. Check out Step 4 for how to wire everything up! What you have does not sound correct to me.

0
None
johnriederermolecule13

Reply 10 months ago

Here's log log. It looks like it didn't upload clean.

Arduino: 1.8.5 (Windows 10), Board: "Pro Trinket 3V/12MHz (USB)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\John\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\John\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\John\Documents\Arduino\libraries -fqbn=adafruit:avr:protrinket3 -ide-version=10805 -build-path C:\Users\John\AppData\Local\Temp\arduino_build_376360 -warnings=none -build-cache C:\Users\John\AppData\Local\Temp\arduino_cache_619687 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\John\Desktop\cloud-lightning\cloud-lightning.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\John\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\John\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\John\Documents\Arduino\libraries -fqbn=adafruit:avr:protrinket3 -ide-version=10805 -build-path C:\Users\John\AppData\Local\Temp\arduino_build_376360 -warnings=none -build-cache C:\Users\John\AppData\Local\Temp\arduino_cache_619687 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -prefs=runtime.tools.arduinoOTA.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avrdude.path=C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9 -verbose C:\Users\John\Desktop\cloud-lightning\cloud-lightning.ino

Using board 'protrinket3' from platform in folder: C:\Users\John\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.9

Using core 'arduino' from platform in folder: C:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20

Detecting libraries used...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10805 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\sketch\cloud-lightning.ino.cpp" -o "nul"

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10805 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\sketch\cloud-lightning.ino.cpp" -o "nul"

Using cached library dependencies for file: C:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp

Using cached library dependencies for file: C:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel\esp8266.c

Generating function prototypes...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10805 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\sketch\cloud-lightning.ino.cpp" -o "C:\Users\John\AppData\Local\Temp\arduino_build_376360\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\John\AppData\Local\Temp\arduino_build_376360\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=12000000L -DARDUINO=10805 -DARDUINO_AVR_PROTRINKET3 -DARDUINO_ARCH_AVR "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\cores\arduino" "-IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.20\variants\eightanaloginputs" "-IC:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\sketch\cloud-lightning.ino.cpp" -o "C:\Users\John\AppData\Local\Temp\arduino_build_376360\sketch\cloud-lightning.ino.cpp.o"

Compiling libraries...

Compiling library "Adafruit_NeoPixel"

Using previously compiled file: C:\Users\John\AppData\Local\Temp\arduino_build_376360\libraries\Adafruit_NeoPixel\esp8266.c.o

Using previously compiled file: C:\Users\John\AppData\Local\Temp\arduino_build_376360\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp.o

Compiling core...

Using precompiled core

Linking everything together...

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.elf" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\sketch\cloud-lightning.ino.cpp.o" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\libraries\Adafruit_NeoPixel\esp8266.c.o" "C:\Users\John\AppData\Local\Temp\arduino_build_376360\libraries\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp.o" "C:\Users\John\AppData\Local\Temp\arduino_build_376360/..\arduino_cache_619687\core\core_adafruit_avr_protrinket3_31f3447a2cf0685b03589d03627321e2.a" "-LC:\Users\John\AppData\Local\Temp\arduino_build_376360" -lm

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.elf" "C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.eep"

"C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.elf" "C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.hex"

Using library Adafruit_NeoPixel at version 1.1.2 in folder: C:\Users\John\Documents\Arduino\libraries\Adafruit_NeoPixel

Sketch uses 5200 bytes (18%) of program storage space. Maximum is 28672 bytes.

Global variables use 144 bytes of dynamic memory.

C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/bin/avrdude -CC:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -cusbtiny -Uflash:w:C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.hex:i

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

Using Port : usb

Using Programmer : usbtiny

avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f

AVR Part : ATmega328P

Chip Erase delay : 9000 us

PAGEL : PD7

BS2 : PC2

RESET disposition : dedicated

RETRY pulse : SCK

serial program mode : yes

parallel program mode : yes

Timeout : 200

StabDelay : 100

CmdexeDelay : 25

SyncLoops : 32

ByteDelay : 0

PollIndex : 3

PollValue : 0x53

Memory Detail :

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack

----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff

flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff

lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : USBtiny

Description : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/

avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)

avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.

avrdude: erasing chip

avrdude: Using SCK period of 10 usec

avrdude: reading input file "C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.hex"

avrdude: writing flash (5200 bytes):

Writing | #######

avrdude: error: usbtiny_send: (expected 128, got -116)

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 3 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 2 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 2 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 5 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 3 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 3 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 2 retries during SPI command

avrdude: 3 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 3 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 3 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 3 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

#avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 2 retries during SPI command

#avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

avrdude: 1 retries during SPI command

# | 100% 126.80s

avrdude: 5200 bytes of flash written

avrdude: verifying flash memory against C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.hex:

avrdude: load data flash data from input file C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.hex:

avrdude: input file C:\Users\John\AppData\Local\Temp\arduino_build_376360/cloud-lightning.ino.hex contains 5200 bytes

avrdude: reading on-chip flash data:

Reading | ###########################################avrdude: 1 retries during read

####### | 100% 0.25s

the selected serial port

does not exist or your board is not connected

avrdude: verifying ...

avrdude: verification error, first mismatch at byte 0x0126

0x34 != 0xff

avrdude: verification error; content mismatch

avrdude done. Thank you.

0
None
molecule13johnriederer

Reply 10 months ago

Yep you're definitely getting an upload error. That can happen for a lot of reasons, and the folks most equipped to help you are the creators of the Pro Trinket, Adafruit. You'll have to head over to the Adafruit forums and ask about using the Pro Trinket on Windows. They should be able to help you out! Post the same information over there (always provide all the information you can, to help debug!) and they'll give you recommendations.

https://forums.adafruit.com/

0
None
DanielM972

10 months ago

So I used your code to put together a string of LEDs that I'm placing into a "lightning staff" for a halloween costume for my son. I'm trying to get the flashes to happen in a lot faster succession (think like something that's charged with electricity). I saw that you have in your code the variables to change the frequency of the lights going, but I'm not sure which way to modify them. Could you give me any pointers? Sorry... I'm not a coder at all...

1 reply
0
None
molecule13DanielM972

Reply 10 months ago

Sure. The way this works is I set a "chance" variable to either 5 (high strike likelihood) or 10 (low strike likelihood). The chance variable gets passed into the "random" function. We can see in the arduino documentation[1] that when the "random" function takes one argument, that argument is the "maximum" value. So it'll return a random number between 0 and that maximum value minus one.

In other words random(chance) in English is: "a random number between zero and chance minus one". So if chance is set to 10 it'll return a random number between 0 and 9, and if chance is set to 5 it'll return a random number between 0 and 5.

Let's look at the whole line[2] and interpret it into English:
if (random(chance) == 3)

if ( the random number between 0 and chance is equal to 3)

...then do the next thing. So, if you want to make it more likely all you have to do is make that statement something that's more likely to happen. So if you want it to do a lightning strike 50% of the time, you might change it to:
chance = 1
if (random(chance) == 0)

The only options for a random number between 0 and 1 are 0 and 1! So 50% of the time (on average) you'll get a lightning strike.

The other thing you might want to change for a more "electricity" effect is the delay between strikes (make the number here smaller): https://github.com/molecule/cloud-lightning/blob/v1.0/cloud-lightning/cloud-lightning.ino#L104

Or the delay between the flashes in the ligthningStrike itself (make the max number here smaller too):
https://github.com/molecule/cloud-lightning/blob/v1.0/cloud-lightning/cloud-lightning.ino#L120

For this part, you'll really just have to mess around with the code until it looks like you want it to look! I don't have any special knowledge that lets me design this: I just played around until I liked it. I hope you'll share your changes with us when you're finished! I'd love to see a video of the completed project. Good luck :)

[1] https://www.arduino.cc/en/Reference/Random
[2] https://github.com/molecule/cloud-lightning/blob/c3af10c57ad2d1b4f775eebefa147384399d5827/cloud-lightning/cloud-lightning.ino#L90

0
None
Clayface18

11 months ago

I juat want to say thank you for your instructable.except for the actual programming part(installing/uninstalling drivers like crazy) everything went smoothly. Your code is amazing and thank you for sharing. Only question i have is there a way to adjust colors of neopixels so they flash different colors?

IMG_9785.JPG
1 reply
0
None
molecule13Clayface18

Reply 11 months ago

You're very welcome! I'm sorry the drivers were a challenge, but nice job on getting it all worked out! And yes: there is a way to adjust the colors of the neopixels :) Here's the relevant line of code:

https://github.com/molecule/cloud-lightning/blob/m...

strip.Color is one of several methods used to change the color of a certain pixel! It takes either two argument (as in my code, linked above), or four arguments (as in the Adafruit tutorial, linked below). They're really the same: they just take the same arguments in different forms. Let's look first at the four argument version.

The first argument is "n", the pixel that you want to change. The next argument is the red value, the third argument is the green value, and the last argument is the blue value. When you're building a color, you'll decide how much of that color you want to be seen for each LED. So, if you wanted to make purple, you might pass in even amounts of red and blue, and zero green:

strip.setPixelColor(pixel, strip.Color(50, 0, 50));

Whereas if you wanted to do turquoise, or any kind of teal/blue/green mixture, you would pass in some amount of green and some amount of blue, and zero red:

strip.setPixelColor(pixel, strip.Color(0, 20, 50));

All mixtures will create a color, you just have to experiment until you find the right amount of mixture for the colors you want. Right now in my code, every value passed in to strip.Color is the same:

strip.setPixelColor(pixel, strip.Color(scaledWhite, scaledWhite, scaledWhite));

That means the LEDs will flash white. I hope that this little extra bit of information helps you!

To learn even more, I highly recommend Adafruit's learning system! https://learn.adafruit.com/adafruit-neopixel-uberg...

0
None
jadedraven

2 years ago

Have you made any headway on your goal of adding a speaker or "weather for the day"? This is amazing on it's own, but I'm imagining a thunderstorm at night for an hour or two, then a "weather cloud" greeting me in the morning and changing throughout the day.

Hoping to order the parts on Adafruit today for a Christmas present.

Untitled.png
4 replies
0
None
molecule13jadedraven

Reply 2 years ago

Yes I have! I expect the final instructions for the "weather cloud" will be up by next weekend for sure. One change is if you want to control the lightning cloud over WiFi, you'll want to use something called the Particle Photon. It's a very easy to use board, and would replace both the Pro Trinket and the Bluefruit modules. (Initially I was thinking I'd need the Bluetooth in place to talk to the Arduino board, but with the Particle Photon everything is combined into one convenient place. Even if you decide you don't want to hook up your lightning cloud to the Internet, you can control it via the Photon just as easily. Here's where to order it one, and I'll post versions of the code that work on the Photon soon:

https://store.particle.io/

0
None
kcyreemolecule13

Reply 1 year ago

I am also interested in the weather cloud idea and about to build a massive (70+ cubic feet) lightning cloud. Since it's being installed in a dark hallway roof, it'd be nifty if I could perform effects aside from lightning. Did you make any further progress toward this, or do you need any help?

0
None
DominicL16digitalmonkeyman

Reply 1 year ago

Id love to try this out as well!!!... till then Ill be ironing out my issues with no lights flickering yet =/

0
None
Kingkeener

1 year ago

Dumb Question: If you used an Arduino Uno to display the lightning effects in the video, how did you transfer the code to the Pro Trinket?