Halloween Forum banner

21 - 40 of 61 Posts

·
Registered
Joined
·
248 Posts
THANK YOU.

And thanks to Vater too. I found a kind neighbor who is going to take the lead on this and help us out - very excited! Hope we can pull it off, stay tuned.
 

·
Registered
Joined
·
248 Posts
Has anyone tried to connect their Arduino to twitter so it can tweet specific hash tags? I read the link posted on page 1 here, but was wondering if anyone has tried it?
All of my parts came in yesterday - excited to get started with my neighbor!

I am thinking I will do the alphabet and lights on insulation foam board so after the party, I can move it where ever I want to have it!
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #23 ·
Has anyone tried to connect their Arduino to twitter so it can tweet specific hash tags? I read the link posted on page 1 here, but was wondering if anyone has tried it?
All of my parts came in yesterday - excited to get started with my neighbor!

I am thinking I will do the alphabet and lights on insulation foam board so after the party, I can move it where ever I want to have it!
It doesn't always have to be connected to a laptop. Once you upload the script, the Arduino will hold it in memory. I can make it loop through several different messages by adding multiple lines of the write function in the code. There are also ways to get it working with a 9V battery if you buy the necessary stuff for the arduino so it doesn't have to be plugged in.
 

·
Registered
Joined
·
110 Posts
Has anyone tried to connect their Arduino to twitter so it can tweet specific hash tags?
It can be done, but that's more typically the domain of your full fledged computers, like the Raspberry Pi, than a microcontroller. An Arduino doesn't generally have an easy way to get internet access (they don't have a networking stack or any built-in way of connecting to either ethernet or wifi), much less reading twitter once it is there. There are shields that can add the necessary stuff to standard Arduinos and recent "internet of things" Arduino products like the MKR1000 that could do it. Also probably "enhanced" clones. Something like the MKR1000 is likely what I'd use if I were starting from scratch.


There are also ways to get it working with a 9V battery if you buy the necessary stuff for the arduino so it doesn't have to be plugged in.
If you have one, you can just run the Arduino off of one of those mobile power banks for cell phones. They output 5V via USB, can be had for about $5 (sometimes less) on Amazon, and are usually big enough to run an Arduino for ages. You just need the correct USB cord, which you will need in order to upload your sketches anyway. (USB A to B for Arduino Uno or Mega. USB A to Mini B for Arduino Nano.)

Depending on how you use it and what you have connected to it, an Arduino might draw between 25 mA and 500 mA while running code, probably on the lower end. 500 is simply the limit for USB.

If the power bank has a typical capacity of 2200 mAh, something like this one, that's a run time somewhere between 88 and 4.4 hours. If all you are running is a data line for LEDs that have their own power supply, you are likely looking at several days of continuous run time. In contrast, a typical 9 V alkaline battery will have a capacity of around 550 mAh, so about a quarter of the run time (considerably less for NiCd, which clock in below 150 mAh).

At Dragoncon, for several hours each day I powered Artie Deco's Arduino Uno -- with Mp3 board and Bluetooth attached -- and a pair of USB speakers at max volume, all from one 10000 mAh power bank. The LED indicator on the battery never even bothered registering less than a full charge. I also ran my radio controller (which has an Arduino Nano and continuously transmits over Bluetooth) off of a $5 lipstick style battery similar to the one above.
 

·
Registered
Joined
·
430 Posts
This is a very cool project. I think that if this was on display at a party or a haunt, I'd like to see the whole sequence run. Right now you've got the startup happening only when it powers up. I changed it to light up the whole strand, flicker, and then show the message. Once that's over, it does it again.

Anytime I've set up an effect like this, people will watch for awhile and then wander off to do other stuff, so I think the whole effect should repeat.

I made a few small tweaks to the Arduino code:

- Moved two of the effects, lighting up the strand and flickering it, into their own functions. This makes the main loop just about controlling everything.
- Added some test lines of text, "abcedfghi" all the way to Z, so you can set up the LEDs and letters on the wall, then un-comment the test lines and see if all the LEDs and letters line up right.
- Added more comments to the code, for people who are getting started out.

Put a space in the message when you want a pause.


Code:
// Stranger Things Alphabet Wall
// From a Halloween Forum discussion:
// http://www.halloweenforum.com/halloween-props/152337-my-stranger-things-alphabet-wall.html
// Original code by Vater

// The Mokungit RGB addressable LEDs come with 50 pixels in the string, so this code
// has been set up to start the alphabet at the end of the string (pixel #50)
// with the LEDs winding back and forth on the wall.  

// When you have the LEDs and letters on the wall, uncomment the "abcedefgh" 
// and other two messages below to check alignment with the letters.  Then comment
// them back out when you're done.

// Updated 10/4/2016 to move "all on" and "flicker" effects into their own functions.
// This makes timing the entire effect easier, and restarts the whole effect each time
// all the messages have been shown.  Also added test strings of letters.

#include <FastLED.h>
#define DATA_PIN 6    // LED pin.  Change this for your setup if needed.

template<typename T, size_t N> constexpr size_t countof(const T(&)[N]) { return N; }

// Set this to match the number LEDs in the string.  Originally 50.
CRGB leds[50];  

// Only a few colors
CRGB colors[] = {
  0xEEEEEE,
  0xFFDD11,
  0x00BBFF,
  0xFF66FF
};

uint8_t index[countof(leds)];

void setup() {
  for (auto &color : colors) napplyGamma_video(color, 2.2);
  for (auto &i : index) i = random8(countof(colors));
  
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, countof(leds));
  FastLED.setBrightness(63);
}

// The loop controls the main effect.  Change pauses to get the timing you want.

void loop() {

  LiteUp();     // Light up the strand of LEDs
  delay(5000);  // Wait five seconds 
  Flicker();    // Flicker them
  delay(2000);  // Wait two seconds before the first message is shown
  
//  write("abcdefgh");  // Uncomment these to test your setup
//  write("ijklmnop");
//  write("qrstuvwxyz");

  write("Help me ");   // Change messages in quotes to whatever you want
  write("Im trapped");
  delay(5000);   // Wait five seconds after the last message before it starts again
}

int getIndex(char c) {    
  c = toUpperCase(c);
  switch (c) {
    case 'A'...'H':
      return 50 - (c - 'A');  

    case 'I'...'P':
      return 30 + (c - 'I');  

    case 'Q':     
      return 39;

    case 'R'...'Y':  
      return 26 - (c - 'R');

    case 'Z':   
      return 17;

    default:
      return 0;
  }
}

void write(char c) {
  if (isAlpha(c)) {
    // Get index and convert to 0-based indexing
    int i = getIndex(c)-1;  // (c)-2 gets to first pixel in strand if needed
    
    leds[i] = colors[index[i]];
    FastLED.show();
    delay(750);
    
    leds[i] = CRGB::Black;
    FastLED.show();
    delay(250);
  } else if (isSpace(c)) {
    delay(1000);
  }
}

void write(const char *str) {
  while (*str) write(*str++);
} 

void LiteUp(){        // Turn all on
  for (size_t i = 0; i < countof(leds); i++) leds[i] = colors[index[i]];
  FastLED.show();
}

void Flicker (){      // Flicker the strand

  for (int i = 0; i < 128; i++) {
    if (random8() > ease8InOutQuad(i*2))
      FastLED.show();
    else
      // To prevent having to repopulate leds[], we
      // simply show black instead of clearing the array.
      FastLED.showColor(CRGB::Black);

    delay(33);
  }
  FastLED.clear();
}
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #26 ·
EDIT 10/21: See JeffHass' post here (page 5) for the most up-to-date code: http://www.halloweenforum.com/hallo...anger-things-alphabet-wall-5.html#post2030962

This is a very cool project. I think that if this was on display at a party or a haunt, I'd like to see the whole sequence run. Right now you've got the startup happening only when it powers up. I changed it to light up the whole strand, flicker, and then show the message. Once that's over, it does it again.

Anytime I've set up an effect like this, people will watch for awhile and then wander off to do other stuff, so I think the whole effect should repeat.

I made a few small tweaks to the Arduino code:

- Moved two of the effects, lighting up the strand and flickering it, into their own functions. This makes the main loop just about controlling everything.
- Added some test lines of text, "abcedfghi" all the way to Z, so you can set up the LEDs and letters on the wall, then un-comment the test lines and see if all the LEDs and letters line up right.
- Added more comments to the code, for people who are getting started out.

Put a space in the message when you want a pause.
Awesome, thanks Jeff! You're absolutely right and I have since added changes to make it loop. I would also add that the code randomly assigns colors based on the hex values specified under "CRGB colors[]". The colors currently specified may not look the best, but they are easy to change. Simply edit the hex color codes. For example FFFFFF is white, 0000ff is blue, ff0000 is red, etc. Add "0x" before the hex value. Use this site to pick your colors and determine what the hex val is for each color you choose: http://www.w3schools.com/colors/colors_picker.asp

Here's another good site for picking colors: http://htmlcolorcodes.com/color-picker/

The colors below should give more of a traditional Christmas lights look. Edit to your liking:
//white
0xFFFFFF,
//yellow
0xFFA500,
//blue
0x0000FF,
//aqua
0x00FFFF,
//red
0xFF0000,
//green
0x008000

(Don't add a comma on the last color value)

Credit to DanRoad for the original code.
 

·
Registered
Joined
·
1 Posts
Hi there, I was wondering if someone can help me with the wiring from the lights to the arduino uno I have. Right now, I have all the parts needed but I can't figure out the wiring aspect of it.
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #30 ·
Hi there, I was wondering if someone can help me with the wiring from the lights to the arduino uno I have. Right now, I have all the parts needed but I can't figure out the wiring aspect of it.
Here are some pics of how I have mine wired:
Here's a simple wiring guide and diagram if you plan on wiring the capacitor/resistor: Adafruit NeoPixel Überguide

Be extra careful not to reverse the negative/positive terminals of the capacitor! Don't do this:


awesome. where did you get the floral wall covering? and did you paint the letters or use a marker?
I bought this: https://amzn.com/B00BFWCSXE

I just wish it wasn't so glossy/reflective...but it works. I need to look around for cheap floral vintage wallpaper. I painted the letters with a small brush and black acrylic paint I found at Michael's. The advantage to the backdrop being plastic is that I can easily wipe the paint off with a damp paper towel before it dries.
 

·
Registered
Joined
·
2 Posts
[


awesome. where did you get the floral wall covering? and did you paint the letters or use a marker?
I bought this: https://amzn.com/B00BFWCSXE

I just wish it wasn't so glossy/reflective...but it works. I need to look around for cheap floral vintage wallpaper. I painted the letters with a small brush and black acrylic paint I found at Michael's. The advantage to the backdrop being plastic is that I can easily wipe the paint off with a damp paper towel before it dries.[/QUOTE]

thank you!
 

·
Registered
Joined
·
5 Posts
Arduino: 1.6.12 (Windows 10), Board: "Arduino Uno"

WARNING: Category '' in library EEPROM is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library SPI is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library SoftwareSerial is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library Wire is not valid. Setting to 'Uncategorized'
Warning: platform.txt from core 'Arduino AVR Boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
In file included from C:\Users\Anna\Documents\Arduino\strangerthingsdelayadded_oct14a\strangerthingsdelayadded_oct14a.ino:18:0:

C:\Program Files (x86)\Arduino\libraries\FastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.003

# pragma message "FastLED version 3.001.003"

^

strangerthingsdelayadded_oct14a:42: error: array bound is not an integer constant before ']' token

uint8_t index[countof(leds)];

^

C:\Users\Anna\Documents\Arduino\strangerthingsdelayadded_oct14a\strangerthingsdelayadded_oct14a.ino: In function 'void setup()':

strangerthingsdelayadded_oct14a:45: error: ISO C++ forbids declaration of 'color' with no type [-fpermissive]

for (auto &color : colors) napplyGamma_video(color, 2.2);

^

strangerthingsdelayadded_oct14a:45: error: range-based 'for' loops are not allowed in C++98 mode

for (auto &color : colors) napplyGamma_video(color, 2.2);

^

strangerthingsdelayadded_oct14a:45: error: no matching function for call to 'napplyGamma_video(int&, double)'

for (auto &color : colors) napplyGamma_video(color, 2.2);

^

C:\Users\Anna\Documents\Arduino\strangerthingsdelayadded_oct14a\strangerthingsdelayadded_oct14a.ino:45:58: note: candidates are:

In file included from C:\Program Files (x86)\Arduino\libraries\FastLED-master/FastLED.h:58:0,

from C:\Users\Anna\Documents\Arduino\strangerthingsdelayadded_oct14a\strangerthingsdelayadded_oct14a.ino:18:

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1695:8: note: CRGB& napplyGamma_video(CRGB&, float)

CRGB& napplyGamma_video( CRGB& rgb, float gamma);

^

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1695:8: note: no known conversion for argument 1 from 'int' to 'CRGB&'

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1696:8: note: CRGB& napplyGamma_video(CRGB&, float, float, float)

CRGB& napplyGamma_video( CRGB& rgb, float gammaR, float gammaG, float gammaB);

^

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1696:8: note: candidate expects 4 arguments, 2 provided

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1697:8: note: void napplyGamma_video(CRGB*, uint16_t, float)

void napplyGamma_video( CRGB* rgbarray, uint16_t count, float gamma);

^

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1697:8: note: candidate expects 3 arguments, 2 provided

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1698:8: note: void napplyGamma_video(CRGB*, uint16_t, float, float, float)

void napplyGamma_video( CRGB* rgbarray, uint16_t count, float gammaR, float gammaG, float gammaB);

^

C:\Program Files (x86)\Arduino\libraries\FastLED-master/colorutils.h:1698:8: note: candidate expects 5 arguments, 2 provided

strangerthingsdelayadded_oct14a:46: error: ISO C++ forbids declaration of 'i' with no type [-fpermissive]

for (auto &i : index) i = random8(countof(colors));

^

strangerthingsdelayadded_oct14a:46: error: range-based 'for' loops are not allowed in C++98 mode

for (auto &i : index) i = random8(countof(colors));

^

strangerthingsdelayadded_oct14a:46: error: 'index' was not declared in this scope

C:\Users\Anna\Documents\Arduino\strangerthingsdelayadded_oct14a\strangerthingsdelayadded_oct14a.ino: In function 'void write(char)':

strangerthingsdelayadded_oct14a:98: error: 'index' was not declared in this scope

leds = colors[index];

^

C:\Users\Anna\Documents\Arduino\strangerthingsdelayadded_oct14a\strangerthingsdelayadded_oct14a.ino: In function 'void LiteUp()':

strangerthingsdelayadded_oct14a:115: error: 'index' was not declared in this scope

for (size_t i = 0; i < countof(leds); i++) leds = colors[index];

^

exit status 1
array bound is not an integer constant before ']' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



|| I am getting all these errors. Can anyone help?
 

·
Registered
Joined
·
5 Posts
I just posted all the errors I am getting with this code. Can you help me with those? These errors are from JeffHaas's code, but I also tried Vater's code and got the same errors. Is there something wrong with my Fastled library or settings?
 

·
Registered
Joined
·
430 Posts
OK, time for basic troubleshooting...

The first thing you should check is that you have the current version of the Arduino software. At the top lett of the Arduino window is the name of the sketch you're working on and a version number. The current one is 1.6.12.

If you have an older one, go to:
https://www.arduino.cc/
Click Download, and get the current version for your computer and install it.

Once you have the current version of the Arduino software, make sure you have the current version of the FastLed library. Start the Arduino software, then go to this menu (this is on the PC, the Mac may be slightly different):
Sketch > Include Library > Manage Libraries

This pops up a window called "Library Manager". In the top right of this window is a search box, type "Fastled" into it. It should find "FastLed by Daniel Garcia" and a version number. Click on that section and some drop-downs will show up that allow you to pick the current version number, which is 3.1.3, and install it. The Arduino software can download the current version and install it for you (this is sooo much easier than what you used to have to do!)

Once you've done that, then you can try out any of the examples that are installed when you add a library. Go to:
File > Examples
and scroll down. Look for "Examples from custom libraries" (you may need to scroll the menu down a bit) and you should see FastLed, hover over it and a window will pop out to the right with all the demos for that software. Pick one like "Blink", it will load up in a new window. Click the Verify button (the checkmark in a circle in the upper left, just under the File menu) to see if it compiles properly. Tip: You can Verify code without having an Arduino hooked up to your computer.

If that works, then you should be able to open a new window (File > New or CTRL + N), paste in either version of the code in this thread and click the Verify button for it. It should compile properly, and then you're ready to actually load it onto an Arduino.

You will still need to hook up the Neopixel strands properly, give them the right power supply, etc etc as described in the Adafruit guide.
 

·
Registered
Joined
·
46 Posts
Discussion Starter · #35 ·
Good advice there from Jeff. I would use this guide to install FastLED: http://www.instructables.com/id/Import-a-Code-Library-to-Arduino/

If you can successfully run the examples that are included with FastLED, you should be able to get the code we provided working. Go to File > Examples > FastLED > DemoReel100. Then you'll want to edit these lines:

#define DATA_PIN 3 <--- Use the data pin number you connected the LED lights to. In my case I used 6
//#define CLK_PIN 4 <-- not applicable for the lights I bought so it's commented out
#define LED_TYPE WS2811
#define COLOR_ORDER GRB <--- The lights I bought should be RGB and not GRB.
#define NUM_LEDS 64 <--- change this to 50 if you bought the same lights I used
CRGB leds[NUM_LEDS];

Once you've edited these lines, are you able to run DemoReel100?

If you can run the examples fine but not the alphabet wall code, then it would be helpful to see screenshots of your setup and the errors so we can go from there.
 

·
Registered
Joined
·
5 Posts
I had the correct version of the Arduino software, but I uninstalled it and reinstalled it again. I installed the library like you said. Then, I ran Blink, ColorPallete, and DemoReel examples and they all worked. However, I am still getting the same errors that I posted above with your code. I am attaching the errors I am getting. I copied and pasted JeffHaas's code. Part 1 errors.jpg Part 2 errors.jpg Part 3 errors.jpg Part 4 errors.jpg
 

·
Registered
Joined
·
430 Posts
Thanks for checking that, it helps troubleshoot.

All those errors show that something isn't set up in the code, so I think that cutting and pasting the code from the forum isn't working for you. So I've zipped up the sketch and have attached it here. Try downloading this file, unzipping it, putting the folder with the sketch in your Arduino folder (on my machine, it's in Documents >Arduino), and then restarting the Arduino software. The sketch should be in the Sketchbook menu.

Then try Verifying it and see what happens.

FYI, my set of these Mokungit lights got slowed by the hurricane in Florida and should get here in a day or so. I've been testing using a shorter strand of 30 LEDs, so there's some code that's commented out to deal with that.
 

Attachments

·
Registered
Joined
·
46 Posts
Discussion Starter · #40 ·
I am still getting the same errors.
First I would try copying the haas_example.ino file inside of the haas_example folder. It appears you have a folder named haas_example.ino then a haas_example.ino file inside of that. Not sure if this would cause issues. Also make sure the file is named haas_example.ino and not haas_example.ino.ino as I'm seeing in your screenshot log. Then try running it again.

Another thing I noticed is before you reinstalled it looks like your FastLED library was located under C:\Program Files (x86)\Arduino\libraries\FastLED-master. Then your code file is located under C:\Users\Anna\Documents\Arduino\. So maybe it was trying to call FastLED.h and is unable to properly call the FastLED library.

I don't have a FastLED-master folder in C:\Program Files (x86)\Arduino\libraries, and based on your log, you do. In my case it's located here: C:\Users\Umbrella\Documents\Arduino\libraries\FastLED-3.1.0

Also I doubt it'd make a difference but I'm running Arduino 1.6.11 and FastLED 3.1.0. Maybe try installing 1.6.11 in case something changed in the new version that is not compatible with the code? Might be worth a shot so we can isolate the problem. You can download this version from here: https://www.arduino.cc/en/Main/OldSoftwareReleases

Seems more like a FastLED problem. it's also possible that something changed in 3.1.3 which is what you're running. You can download 3.1.0 from here: https://github.com/FastLED/FastLED/releases/tag/v3.1.0


C:\Users\Umbrella\Documents\Arduino\libraries\FastLED-3.1.0/FastLED.h:12:2: warning: #warning FastLED version 3.001.000 (Not really a warning, just telling you here.) [-Wcpp]

#warning FastLED version 3.001.000 (Not really a warning, just telling you here.)
 
21 - 40 of 61 Posts
Top