Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
8

You can't rely on the timing reported by millis when comparing FastLED and Adafruit's neopixel library. Writing out Neopixel data involves disabling interrupts, which is what the clock uses to advance. FastLED accounts for this and attempts to update the system clock time after writing out led data to account for the amount of time that interrupts were ...


5

Not really an applause detector, but I have written a sound meter program you could use as a starting point for your own project. It is available here: Arduino sound meter. It works as follows: the analog input is read at a constant rate of about 9600 samples per second, which is normally fine for telephone quality audio processing the DC offset from the ...


5

When something works, but not completely, it's often due to power issues. Embedded things, microcontrollers/Arduino are fairly robust and "logical". Hence, if your Arduino program works today, it'll work tomorrow. Analog devices, or electricity is (in my eyes) often a bit vague. A chip can get enough power to run, but not enough to work properly. The ...


5

NeoPixels The strips based on the WS2812 / SK6812 and similar chips, known by some as NeoPixels, are clever ways of implementing fully-addressable 24-bit colour LEDs. One of the clever things is that they only require one data wire, plus power and Gnd, i.e. +5V Data Gnd The pixel information is sent by precisely timed sequences of 24 bits per pixel. The ...


5

Neopixels only have one-way communication. Some possible ways to detect the quantity are: Bring the Data-Out of the last pixel back to the arduino and activate an interrupt on an input pin connected to that. If you write 144 LEDs worth of data to the 144-LED strip, the pin doesn't change. If you write 144 LEDs worth to a 60-LED strip, the pin changes. So ...


4

Each pixel "peels off" the first data word before passing on the rest, so the payload gets shorter and shorter as you move down the chain. Although the data wire may look continuous it isn't - the signal is electrically re-driven from each unit to the next. For the RGB ones, they are logically three monochrome pixels of different colors, so they peel off ...


4

I am not sure I fully understand your exact problem but you have to be aware that holo_pxl.setPixelColor(1, c); set the color of the second LED in a NeoPixel chain, NOT the first one. For the first LED, you have to use holo_pxl.setPixelColor(0, c); instead.


4

It is possible to do this by feeding the end of the strip back into the arduino. bunnie Huang blogged about doing this a few years ago: http://www.bunniestudios.com/blog/?p=3345 He has schematics and firmware which uses a modified neopixel library that can measure the length of the strip.


4

I don't think that will be an option. The NeoPixel parts need very tight control of the timing in order to work, if the pin timing is wrong by 100 us the wrong data will get latched in. Can you move some other functions / pins onto the IO expander and then drive the neopixels directly from the processor?


4

break it down into blocks to determine the upper left corner of any 8x8 grid const int16_t grid[8][8] = { {0, 15, 16, 31, 32, 47, 48, 63}, {1, 14, 17, 30, 33, 46, 49, 62}, {2, 13, 18, 29, 34, 45, 50, 61}, {3, 12, 19, 28, 35, 44, 51, 60}, {4, 11, 20, 27, 36, 43, 52, 59}, {5, 10, ...


3

As noted in Chris Stratton's answer, “Each pixel "peels off" the first data word before passing on the rest, so the payload gets shorter and shorter as you move down the chain”. This behavior is spelled out clearly in WS2812.pdf and WS2812B.pdf datasheets from http://www.world-semi.com : The data transfer protocol use single NZR communication mode. ...


3

Depending on how loud your audio signal is, you may be able to do it with just one capacitor and two resistors: If your signal is quite quiet, though, you may need to amplify it using an op-amp. For instance: That arrangement would double the volume of the audio. It also has the effect of inverting it, so you will need to invert your readings in software. ...


3

LED strips with WS2811 and 12V are the ones with one driver and 3 RGB LEDs on it. These are interconnected so you just can't control less than whole group of three. If you need individual control, you have to get 5V variant with WS2812.


3

You don't modify the library at all. The page refers to the constructor which is the last line here: #include <Adafruit_NeoPixel.h> #define PIN 6 Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); So that would send to 60 NeoPixels. Change the 60 to however-many you have. To compare, try running my library here. That doesn'...


3

Since you are connecting your pixel strip in parallel with R2, the correct formula is Vout = Vin × (R2∥Rp) / (R1 + (R2∥Rp)) Where Rp is the resistance of the pixel strip and R2∥Rp = R2 × Rp / (R2 + Rp) is the combination of R2 and Rp in parallel. From this you can see that an output voltage of 1.6 V is consistent with a strip resistance of 300 ...


3

I like the ws2812 RGB LEDs with integrated controller. They can be found on adafruit.com, e.g. here: Adafruit NeoPixel NeoMatrix 8x8. There are some good tutorials on adafruit.com: https://learn.adafruit.com/adafruit-neopixel-uberguide/overview https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices https://learn.adafruit.com/adafruit-...


3

Try changing rgbIndex++; to rgbIndex=(rgbIndex+1)%numRGBleds;. I thing the problem is the int rgbIndex rollover, which occurs after about 9 hours. Also try changing delay(1000) to delay(1). That way the problem might pop up a lot faster.


3

According to https://learn.adafruit.com/adafruit-neopixel-uberguide/powering-neopixels a Neopixel can consume 60 mA at full brightness white. Each individual NeoPixel draws up to 60 milliamps at maximum brightness white (red + green + blue). In actual use though, it’s rare for all pixels to be turned on that way. When mixing colors and displaying ...


3

This indeed looks awesome! I suggest getting rid of the big grid array, and instead generate the mapping programmatically. Given that it is very regular, the mapping can be computed instead of stored: uint16_t remapXY(uint16_t x, uint16_t y) { // Compute panel position and offset of pixel within that panel. uint8_t pannel_x = x / 8; uint8_t ...


3

delay(0) apparently[*] acts like delay(2^32) or about 10^10 milliseconds. That may not be what you had in mind ... :) Try reducing the delay to 1 or use delayMicroseconds() to get something shorter. That should at least get you some repeatable results. (10^10 mSec is ~ 16.5 weeks, for those without a calculator handy). [*] I didn't read the code, nor ...


3

You don't use the correct syntax. I assume you mean: // NeoPixel Display if ((counter >=3) && (counter <=9)) { strip.setPixelColor(0, 255, 0, 0); //set pixel number 1 and set color to red strip.show(); //send color to pixel 1 on NeoPixel Ring } else { strip.setPixelColor(0, 0, 0, 0) strip.show(); } And similar for the other ...


3

A reasonable estimate for current consumption of 5V NeoPixels is 60mA per pixel. For 186 pixels, that means about 11.16A at 5V; well over the 2.4A of the adapter being used for your other components. There exist modules called "DC-to-DC Buck Converters", which can step down the 12-14V of your automobile to pretty much any voltage under the input voltage. To ...


3

You have two issues going on - noise pickup, and a potentiometer with imprecise stops at one or both ends. The pot is the easiest to fix: What are the lowest low reading and highest high reading you can reliably get when you turn it to its stops? Use those in place of '0' and '1023' in your map() function. Improving the noise is only slightly more involved....


2

As far as I can make out (eg. NeoPixels Revealed: How to (not need to) generate precisely timed signals) the NeoPixels are not in fact addressed, but are like a long shift register. Thus if you have 10 pixels, you have to send out 10 lots of RGB colours and then latch them. This is why you need to know how many pixels you have, so that you send out the right ...


2

The #define is just letting you use a nice name for the numeric value of the pin. If you want to use two different pins, you use two different names. So you might define them at the beginning something like: #define BOARDLED 8 #define STRIPLED 6 Then you create a NeoPixel object that uses that pin. In your case, you'll do this twice. Adafruit_NeoPixel ...


2

I don't know much about neopixel but as a general coding practice if you want to do something for every other object, you use the modulus operator like so if(i % 2 == 0) { //i is even //off } else { //i is odd //on } So just wrap your current for loop in another one and to the above with the iterating variable.


2

After some discussion it turned out to be a hardware problem. For the sake of completeness I'll outline the suggestions I made. There was some initial confusion (see the edits) where the hasBeenSet flag was initialized the wrong way around. I could not reproduce the problem on my Uno and my WS2812 chip, so the issue was: what was different between his setup ...


2

I was having the same problem until I read the library source code. Later I found the documentation reference. The classic font cursor position is defined as the top-left corner of the character cell. For GFX and custom fonts it is the 'y' position is relative to the baseline of the character cell. My display is 5 by 5. The TomThumb font is 3 by 5. ...


2

As pointed out by Delta_G, there is no point in resetting your program. What you should do is think your program in terms of the Arduino logic: You put in setup() the code you want to run when your program starts. You put in loop() the code you want to run over and over again. In this case loop() is fairly simple, as the stuff you want to run over and over ...


2

Your "constructor" isn't doing what you think. In the example you point to you have, efectively: Class object = Class(parameters); Whereas in your code you have: Class object; object = Class(parameters); In the first form it results in a new object constructed at declaration time. In the second it first creates a new "empty" object and then at a later ...


Only top voted, non community-wiki answers of a minimum length are eligible