tag 标签: NeoPixel

相关博文
  • 热度 22
    2015-6-12 18:28
    1695 次阅读|
    0 个评论
    After reading Max’s blog on the Neo-Pixel clock by Duane Benson, I decided leap into the fray and make one myself.    The first challenge was to assemble the four 15-LED segments that make up the 60-LED ring. I saw how Duane had assembled his but I wanted to do it a little differently. I like to make and use the odd jig. Lucky for me I have a wood turning lathe and some skills in woodturning, and that’s where this particular blog is leading: a demonstration on how I made the jig to assemble the four Neo-Pixel segments and the mount or clock face for the three Neo-Pixel rings.   All I need for this jig is a disk of wood I can cut a circular groove into with sufficient depth that the LED segments fit into it snugly, with the LED’s facing downward and where the circuit board is flush with the jig face. This permits maximum accessibility for solder the joints and secure enough not to move:     First I had to find the internal and external radius of a finished60-LED ring, so I took a piece of paper, drew a big + on it, lined up one of the segments as shown in the image below, and measured the internal radius to the centre of the +. The width of the PCB was then added to the internal radius measurement to obtain the external radius.     I won’t go into the detail of how I created the jig because I include a video below on how I made the mount for all three Neo-Pixel rings. The process is exactly the same, so more about that in a moment.   With all four segment inserted into the jig, I used Duane’s method for connecting the four segments together. Although the jig worked perfectly it unfortunately can’t be used again without re-work, because the wood has shrunk in one direction due to temperature and humidity differences between my garage (where the wood was stored for years) and the house where it resides now. This means the grove is no longer an accurate circle but more of a slight ellipse. This is a common problem when working with wood but it can be worked around in various ways, like acclimatizing the wood in the environment where it will ultimately reside before turning it, or roughing it out, leaving it for a some time to settle (days, weeks, or sometimes months) before finishing.   With three complete and tested Neo-Pixel rings, it’s time to make a mount for them. After some deliberation I decided to mount the rings concentrically mainly for ease of construction. This is where the lathe comes into its own.   I found a nice piece of sycamore and mounted it to a faceplate with four screws and attached the faceplate to the lathe. The lathe headstock is swung out to give better access for the first task, which is to true up and finish what will be the back face of the clock mount. I also need to cut a 25 mm diameter chamfered recess in the back face for remounting the disc to a four-jaw chuck when creating the front face.     I used four tools for to make the clock face as can be seen in the next image. From left to right, these include a round skew chisel; modified bowl gouge with a fingernail grind that has more flexibility in the types of cut it can make; a standard roughing out gouge normally used in spindle turning; and a parting tool.     There are two main types of woodturning: bowl and spindle, and the difference is the direction to wood grain is presented on the lath. Each type of woodturning has it’s own tool set best suited for the purpose. The type of turning employed here to make the clock face is bowl turning even though it’s not going to be a bowl. The bowl gouge is used to true up the blank in 2 ways, for finer cuts, by dragging the long cutting edge of the gouge across the blank from centre out and for more aggressive cuts using the short cutting edge (tip) from the outer edge inward and truing up the edge or circumference.   The roughing out gouge more suited to spindle turning is used to make the face nice and flat and remove the tooling marks left by the bowl gouge. In all honesty I should be able to do all this with the bowl gouge, but I’m not skilled and practiced enough to do it well. So I cheat by using the roughing out gouge, which I find easier to control when trying to obtain a very flat and smooth surface that requires very little sanding.   The parting tool is ideal for cutting grooves and the skew chisel is used for creating the chamfer or undercut depicted in the four jaw chuck image above. The diameter of the recess must be very fractionally larger in diameter than the chuck jaws when fully closed; in this case it’s about 25mm. The chuck jaws have a slight chamfer to them so the recessed chamfer needs to be a similar angle so when the chuck jaws expand they grip the wood disk firmly. (You wouldn’t want the blank to fly off the lathe, believe me it’s happened and its scary.)   Lets now have a look at the video before I conclude with a textual version of the remaining tasks:   (Note: Besides the jig setup, you can also see the clock in operation near the end of this clip.)   The back of the mount is then sanded using 180, 240, 320, 400 600 grit abrasive, sealed with two coats of sanding sealer, sanded again with 600 grit, and finished with a wax to make a very smooth surface.   The faceplate is carefully removed from the lathe, and I use my woodturning tunic to protect the finished back face from damage while the faceplate is removed.   Unfortunately I failed to record decent video footage for some of these activities described here and the video appears to skip bits. Hopefully this dialog is sufficient to fill in the gaps.    A four-jaw chuck is then fitted to the lathe and the recess in the back face is slipped over the closed chuck jaws. The chuck jaws are then expanded until they sufficiently grip the wood disc so as not to damage the wood itself. This makes a very secure fixing for the remainder of the turning.   Next the edge and front face is trued up and the diameter of the finished clock face is measured and drawn on in pencil; the diameter I chose was 190mm. Next the diameter of the disk is reduced using the bowl gouge and finished using the roughing out gouge. This is done with the work face directly over the lathe bed for best accessibility.   In the video I chose to make the clock mount quite deep at 18mm. This was to allow for the screws I was to use when mounting the electronics. The fixing method changed before too long and the thickness reduced to 10 mm; this reduction is unfortunately not shown in the video. The required thickness is measured and a line drawn around the circumference, and this was done prior to rotating the lathe headstock outward for better access.   Most of the excess wood is removed using the bowl gouge tip from outer to inner, then cleaned up using the long cutting edge from inner to outer just like the back face. Final truing and flattening is then done using the roughing out gouge. I then sanded the face down to 600 grit, sealed with sanding sealer, and finished with 600 grit again, but without wax this time.   The rings were measure and the inner and outer ring diameters marked in pencil on the now flat and smooth front face. The parting tool is used to cut the grooves for each ring taking it a little at a time and checking to see if the rings fit before cutting the grove to its final depth of 4.5mm. This depth leaves the Neo-Pixels about ½ mm below the clock face.   Before removing the now finished mount from the lathe and after masking the outer circumference, I painted the front face with matte black spray paint and a clear lacquer. After the paint and lacquer were dry I removed the mount from the lathe.   Not shown in the video (because I forgot to record it) is the marking out and drilling of the holes in the groves for the power and signal wires that attach to the Neo-Pixel rings to pass through to the back of the mount. Measurements were taken from relevant solder pads on each of the Neo-Pixel rings for +5 V, 0 V, and Data In and transferred to the mount for drilling.     I have turned a housing for the clock face and added a diffuser to give the project a little pizazz, so more to come in another column, but here is a sneek peek at what the clock currently looks like:   In the meantime, did you find this short introduction to some wood turning techniques interesting? Maybe you found it an inspiration for you to go and try woodturning for yourself? Let me know your thoughts by posting comments and questions.   Steve Manley (a.k.a. Steve the Sensational) is a Desktop Consultant for a large IT outsourcing company. Steve specializes in the creation and deployment of Windows images within the UK Nuclear Industry. He moved from a CI maintenance role at the UK's flagship Nuclear power station (Sizewell B) in the late 1990's into IT support and has enjoyed working in this field ever since. Steve obtained an HNC in Electronics way back in the early 1980's and now has multiple areas of expertise that include analog and digital electronics design and embedded software development. As a hobby, he loves anything and everything to do with systems involving flashing lights.
  • 热度 19
    2014-9-30 17:01
    3286 次阅读|
    0 个评论
    Many diverse aspects have to be reviewed with regard to a project like my Bodacious Acoustic Diagnostic Astoundingly Superior Spectromatic (BADASS) display. In my previous blog on this topic, I showed a pencil sketch illustrating my first-pass thoughts for the front panel of the display. As you may recall, I'm going to use a large piece of plywood stained to look like dark, old wood. Inlayed in this is going to be a piece of pressed board, which I'm going to paint to make it appear to be antique brass.   Before I actually start building something like this, I'm a great believer in creating a prototype using cheap-and-cheerful materials like paper and cardboard. This allows me to play around with different placements and proportions and suchlike without actually spending a lot of my hard-earned dosh. It also tends to save a lot of time, effort, and money in the long run.   Several days ago, my realtor wife (Gina The Gorgeous) had to go into work. As soon as she left the house, I whipped out a bunch of rulers and protractors and pencils and paper and card, and set to work. One of my first tasks was to use Visio to create some "birds-eye" drawings of things like washers and acorn nuts and momentary pushbuttons.     Why washers? Well, I'm going to have a 16x16 array of LEDs. I'm planning on having a disk of translucent white film in front of each LED. Also in front of each LED (sitting on top of the translucent film) will be a brass washer, which I will artificially age. I don’t know why, but I think this could look rather tasty.   One useful tip, should you ever do anything like this yourself, is to include faint vertical and horizontal lines in your Visio drawings as illustrated below, because this will save you a lot of messing around downstream. All you have to do is use scissors to quickly cut between the images (you don’t have to precisely cut around them). Later, you can use these lines to quickly and easily line things up on the main piece.     One thing I really wish is that I'd had some sort of training in industrial design (I wonder if anywhere local to me offers night-school courses in this sort of thing). Unfortunately, I pretty much have to make things up as I go along. My first decision was that the white translucent disks (and the holes behind them) would be 10mm in diameter. Why did I pick 10mm? Well, I'm using Adafruit's tri-colored NeoPixels. These NeoPixels are 5mm x 5mm square, which means they are 7mm across the diagonal. The NeoPixels I'm working with are mounted on a strip, so using 10mm diameter holes will give me a minimum of 1.5mm of "wriggle room" on either side.   When it comes to the washers, we know the diameter of the hole in the middle will be 10mm, so the next step is to decide on the outer diameter. The image above reflects an outer diameter of 20mm, which means the width of the brass band will be 5mm (i.e., half the diameter of the hole in the middle).   My initial gut feel was that a 20mm outer diameter was what I wanted, but I wasn't 100% certain, so I created a couple of alternatives as illustrated below. The four columns on the left show "washers" with a 20mm outer diameter; the next two columns have a 17.5mm outer diameter; while the two columns on the right have a 15mm outer diameter.     Based on this simple experiment, I decided that my original plan of 20mm was the correct way to go. Now, as I already mentioned, I'm using Adafruit's NeoPixel strips. The type I've opted to use boast 30 NeoPixels per meter . I'm going to mount these strips vertically to form the columns on my display, which means that the vertical distance between adjacent pixels will be 1000mm/30 = 33.3333mm.   I decided that I didn’t want to arrange my 16x16 as a perfect square. Making it rectangular will give it more visual appeal. I believe that the human brain spots subtle ratios and relationships at an unconscious level. I also believe that if things are in proportion as obvious multiples of each other, they tend to be more pleasing to the eye than if their proportions are random. I may be wrong on this -- as I say, I've not had any formal training so I just muddle along as best I can.   In this case, I decided that the spacing between adjacent columns should be 1.5X the spacing between adjacent rows, which means 33.33mm * 1.5 = 49.99mm, which I rounded to 50mm. Following this decision, I marked out the full matrix and affixed my paper "washers" in place using Elmer's all-purpose glue, as illustrated below.     The next step was to determine the placements for the brass acorn nuts, which I'm going to use to hold this panel in place. The easiest solution would be to have one nut for each row and column, but that would look like total overkill. Last week, when I was bouncing ideas around with my chum Willie -- the mechanical design engineer whose office is in the next bay -- he made the very good point that the function of the acorn nuts was totally divorced from the function of the washers. Based on this, Willie had suggested that the spacing between the acorn nuts should reflect this difference in function. A close up view of one of the corners is shown below.     The distance between the center of the acorn nuts and the center of the nearest washer is the same as the vertical separation between adjacent pixels; that is, 33.33mm. The distance between the center of the acorn nuts and the edge of the board is half of this value; that is, 16.66mm. At this point, I ran into a bit of a conundrum. Consider the following image.     Let's start with the seven nuts on the left-hand side. I started by placing an acorn nut in each corner. I then placed one in the center of the left-hand side. I then played with my nuts for a while (stop smirking, it doesn’t become you) and eventually decided that adding two nuts between the center and each corner resulted in the effect I was looking for. The end result was a vertical spacing between nuts of around 91mm.   Now consider the bottom side of the above image. Again, I started by placing a nut in the center of the bottom side, because this matched my having nuts in the center of the left- and right-hand sides. In this case, I tried adding four nuts between the center and each corner, but that resulted in a horizontal spacing between nuts of 80mm. The difference between the vertical spacing and the horizontal spacing just didn’t "feel right."   As you can see, there are eleven nuts on the bottom edge with ten "gaps" between them. Now look at the top edge. In this case there are ten nuts, with nine "gaps" between them. Although this means there isn’t a nut in the center of the top edge, it does mean that the horizontal gap between nuts is now 88.88mm, which is close enough to the vertical gap of 91mm on the edges to fool the eye. The end result is that -- when I come to construct the real display -- I will be using the 10-nut arrangement for the top and bottom edges.   In the fullness of time, I will be experimenting with a variety of different display modes, so I'll need some way to switch between them. Originally I was thinking of embedding an LCD display in the front panel (I was thinking of using a black-and-white display, and making it look like a CRT-type unit). But my chum Ivan, who also has an office in the next bay, gave the opinion that this was a waste of time, effort, and money. As he pointed out, I can actually use my 16x16 LED array as the option/menu display -- all I need to do is add is a small control panel with some momentary push buttons as shown below.     This panel will also be formed from pressed board painted to look like antique brass. The red button is the "Reset" button; the green button is the "Menu/Select/OK" button that will allow you to enter and exit the menu system and select amongst the various options; and the four black buttons will allow you to scroll "Up," "Down," "Left," and "Right" between the various options. Below we see a closer look at this control panel.     Putting this all together, below we see the main LED array and the control panel glued on to a piece of cardboard. In the real display, the cardboard will be replaced with the plywood stained to look like dark, old wood.     In this case, I started by making the distance between the edge of the LED array panel and the edge of the cardboard on the left- and right-hand sides 10cm (2X the horizontal distance between NeoPixel Elements). Similarly, the gap between the top-edge of the LED array panel and the top of the cardboard is 10cm. In the case of the control panel, we have a 5cm gap above and below it, which means that the total width at the bottom is 20cm (i.e., 2X the width of the sides and the top).   As you can see from the final image below, the end result is a tad larger than I had originally envisaged, but I think it's going to look outrageously tasty. Can you imagine this little beauty lit up in all its glory? I cannot wait!   Yours truly in his 'Kilroy was here' pose.   So, why have I just spent so much time waffling on about all of this? Well, there are several reasons, actually. First, I thought you might be interested to hear the mental process behind my decision-making. Second, these directions will hopefully come in handy if you decide to create such a display for yourself. Third, if you have any industrial design experience or knowledge, I would really welcome any feedback as to the decisions I've made. Do they make sense? Is there anything I should change? Are there any "rules of thumb" of which I should be aware? And are there any good books on industrial design you would recommend?   Building a BADASS display (Part 5)
  • 热度 23
    2014-9-30 17:00
    2049 次阅读|
    0 个评论
    So, my Bodacious Acoustic Diagnostic Astoundingly Superior Spectromatic (BADASS) display sappears to be gaining some interest, possibly based on the YouTube videos I've presented of similar items. (See Building a BADASS display (Part 1) and Building a BADASS display (Part 2) ) Now all we have to do is build it (LOL).   Just to recap, I've decided on the overall look and feel of the first incarnation, as illustrated below. My first big decision is using a 16x16 array of tri-colored LEDs. The panel on which the LEDs are mounted will be pressed board painted to look like antique brass. This board will be mounted on a larger plywood panel stained to look like expensive cherry wood. The two boards will be attached using brass acorn nuts, which I'll age to look old. (All this was discussed in more detail in my previous blog on this topic.)   First-pass look and feel for Max's BADASS Display.   Now, since I've been spending so much time playing with Adafruit's NeoPixels recently, I've decided to use these for this project. The great thing about these tri-colored LEDs is that each one contains their own PWM controllers (one each for the red, green, and blue sub-channels), and they have only four pins: power, ground, data in, and data out. You can daisy chain hundreds of the little scamps together and control each element in the chain individually using only a single pin on your microcontroller.   If I were going for a smaller display, I might be tempted to use Adafruit's new 8mm diffused NeoPixels and the associated WS2811 driver chips . However, I've decided to use Adafruit's NeoPixel strips. Of course, I am tempted by the 144 NeoPixel per meter strips, but these are rather expensive, and the resulting display would be quite short. To get around this, I'd be tempted to use 32 or 64 elements per column, but that would further increase the cost and complexity.   What I need to do is get my first-pass display up and running and use it as the basis for any future versions. Similar issues -- cost and small display size -- would come with the 60 NeoPixel per meter strips. Thus, I've opted for the 30 NeoPixels per meter strips, as illustrated below.     One downside to using NeoPixels is that they are a bit temperamental with regard to timing. In real terms, this means you have to use an Arduino Uno or an Arduino Mega. I'll use an Arduino Mega . Furthermore, since I'll have 54 digital input/output pins at my disposal, I'm thinking of using 16 pins to drive 16 strips, each of which will form one of my columns, as illustrated below.     OK, that's the easy part done (well, decided). This is where things start to become more complicated. I know I'm jumping around a bit here, but I've got all sorts of ideas buzzing around in my mind. As a starting point, let's assume that we are working with a mono audio stream, and that we will present the lower frequencies on the left side of the display and the higher frequencies on the right.   Let's further assume we will use the entire column to represent the amplitude. One possibility is to divide the columns into four colored bands, as illustrated in (a) below. Another option is to keep the same bands but make the entire column the highest-amplitude color, as shown in (b).     An alternative is to make the signals grow out from the middle, as illustrated in (c). A variation on this theme would be to make the signals grow up from the bottom and down from the top, as illustrated in (d).   Of course, the (c) and (d) versions could be used to display the two channels from a stereo audio stream, but I want to keep things reasonably simple in this first iteration of the display, so I'm sticking with mono. Actually, this raises a question. To drive my display, I will use my iPod or my iPad, both of which have stereo outputs. Thus, I will need to combine the two stereo channels into a single mono channel. Remember that I've not really played with audio like this before, so I'm going to need to work out how to do this.   Two more questions that pop into my mind at this point are how we scale the horizontal and vertical axes. Let's start with the horizontal axis. We will divide the audio spectrum into 16 buckets. Let's say that the lowest bucket includes anything equal to or less than 50 Hz, while the highest bucket includes anything equal to or greater than 16 KHz. How do we divide the frequencies across the remaining buckets? Do we go linear and partition things into equal chunks, or should we perform the split in a logarithmic manner?   The same question applies to the vertical axis. When it comes to presenting amplitude, my knee-jerk reaction is that a logarithmic presentation is the way to go. Once again, however, audio signal processing and display is not my area of expertise; perhaps the amplitude should be presented in a linear manner. The next consideration is that an Arduino Mega has only 8 KB of RAM, which is pretty limiting in the scheme of things. Also, the poor little ragamuffin runs at only 16 MHz.   When I decided to create my BADASS Display, my first thought was to use digital signal processing (DSP) techniques to extract the spectrum information from the audio stream. If I were to go this route, should I use a fast Fourier transform (FFT), a discrete Fourier transform (DFT), a discrete cosine transform (DCT), or something else entirely?   But then I started to worry that my poor little Arduino Mega might not be up to the task. What I really want my Mega to do is focus all its attention on displaying the information. This means that I need to extract the spectrum information from the audio stream by some means and then simply present it to my Mega along the lines of "Bucket/Column X = Amplitude/Row Y."   If I performed my signal processing in the digital realm by means of an FFT, DFT, or DCT, then one solution would be to use a second processor. For example, I could use a chipKIT Max32 to perform the DSP and feed the results to my Arduino Mega via an I2C link, as illustrated below.     Another alternative is to move the signal processing into the analog realm. This is based on the fact that my Arduino Mega has 16 analog inputs. I was thinking about creating a simple four-pole band-pass filter using an op-amp combined with a few discrete components. Then I would replicate this 16 times, varying the values of the resistors and capacitors for each stage to extract the appropriate portion of the spectrum, as illustrated below.     One reason I thought this op-amp solution might be interesting is that it would be relatively easy for a hobbyist to implement. Also, it would be scalable. If you could afford to implement only a four-channel display, for example, you could simply select the appropriate discrete components to divide the audio spectrum into four bands.   But then I started to think about the problems involved in setting everything up. Also, these op-amps would be set to some nominal output level. If you have a prolonged quiet piece of music, you might want to boost the outputs on the display a little. By comparison, if you have a prolonged loud piece of music, you might want to do something else at the outputs. All these considerations swung my attention back to performing my signal processing in the digital realm.   There is, of course, another option. Suppose I were to implement the DSP functions in an FPGA, which can perform a humongous amount of processing in a massively parallel fashion. For example, suppose we had the scenario illustrated below.     In this case, we're probably looking at a lower-cost FPGA, so we'll use an external analog-to-digital converter. How many bits should I use? Eight? Ten? Twelve? I'd also like the FPGA implementation to be scalable and configurable. Maybe my Mega can send a series of configuration instructions telling the FPGA how many channels we want and the frequency band for each channel.   We could then leave the FPGA to do the heavy lifting -- sampling the audio stream and generating the spectrum data. The Mega could read the values for each channel periodically and then go off and concentrate on displaying the results.   Good grief. There are so many options available that my head is spinning. I'm going to go ponder this further. Meanwhile, if you have any expertise in this area, this would be a really good time to wave your hand in the air and say, "Max, I'd love to help."   Building a BADASS display (Part 4)
  • 热度 22
    2014-5-29 18:52
    1898 次阅读|
    0 个评论
    As you will doubtlessly notice, a lot of my current hobby projects --such as my Infinity Mirror and my BADASS Display --are based on NeoPixel rings and strips from Adafruit.com   In turn, Adafruit's NeoPixels are based on the WS2812 integrated light source from Worldsemi . This is an incredible little device that is only 5x5 mm square (and about 1 mm thick). Each WS2812 includes a tiny constant-current driver chip, along with three incredibly bright red, green, and blue (RGB) LEDs.     One area of potential confusion is that you sometimes hear people saying WS2811 or WS2812 when referring to these elements. In fact, WS2811 refers to the driver chip, while WS2812 refers to the larger package containing the WS2811 driver chip along with the RGB LEDs.   The great thing about these devices is that they can be daisy chained together, and the entire chain can be controlled using a single digital output pin on your microcontroller. Each WS2812 has four terminals: 5 V (power), 0 V (ground), data in, and data out. When you use your MCU to output a stream of data to the chain, each WS2811 accepts the first 24 bits it sees (eight bits for each RGB color channel) and then buffers and retransmits the remainder of the data stream to the next WS2811 in the chain.   Now, one of the things I really like about the NeoPixels from Adafruit is that they come equipped with an Arduino library and some really easy-to-use examples. You can literally be up and running within a couple of minutes. Let's use some simple pseudo-code examples. First, we instantiate a chain of NeoPixels:   NeoPixel myChain = NeoPixel(60, 6);   In this example, the first parameter (60) is the number of pixels we have in our chain. The second parameter (6) is the digital I/O pin we wish to use to drive the chain. If we wish to set the color values associated with one of the pixels in the chain, we might use a function call like the following:   myChain.setPixelColor(i, c);   In this case, the first parameter ('i') is an integer between 0 and 59 that specifies the pixel of interest. The second parameter ('c') is a 24-bit value comprising three eight-bit fields to define the RGB values to be associated with this pixel.   Of course, we could use loops and other control structures to specify the values of multiple pixels. The important thing to note here is that the "setPixelColor()" function doesn't actually modify the physical pixels. When we originally instantiated myChain, we created an array of 60x24-bit elements in the Arduino's memory. When we use the "setPixelColor()" function, all this does is change a value in the memory array. When we are ready to rock and roll, we use the "show()" function as follows:   myChain.show();   One other thing I really like is the fact that Adafruit's NeoPixel library allows you to instantiate multiple chains. Suppose I decided to use eight chains, each containing 60 pixels. A pseudo-code version of this might be as follows:   NeoPixel myChain0 = NeoPixel(60, 6); NeoPixel myChain1 = NeoPixel(60, 7); NeoPixel myChain2 = NeoPixel(60, 8); NeoPixel myChain3 = NeoPixel(60, 9); NeoPixel myChain4 = NeoPixel(60, 10); NeoPixel myChain5 = NeoPixel(60, 11); NeoPixel myChain6 = NeoPixel(60, 12); NeoPixel myChain7 = NeoPixel(60, 13);   Now, I love working with NeoPixels, but there are some downsides. For example, the timing requirements to upload data to a NeoPixel chain are so stringent that Adafruit implemented things using assembly code that runs only on 16MHz Arduino Unos and Megas, both of which are eight-bit machines.   Another small gotcha is that, when you call the "show()" function, it disables the Arduino's interrupts. The CPU is totally dedicated to outputting the data to the chain. Now, suppose we have instantiated multiple chains as shown above. Consider what happens if we do the following:   myChain0.show(); myChain1.show(); myChain2.show(); :   Though this might be advantageous for organizing, visualizing, and controlling a display, it doesn't confer any speed advantages. Each chain is processed one after the other. Apart from anything else, this might result in some unwanted visual artifacts if we are driving long pixel chains.   All of which leads me to some interesting information I discovered while chatting with Paul Stoffregen, one of the founders and owners of PJRC.com . One of PJRC's products is the Teensy 3.1 Arduino-compatible development board, which is an incredible bargain at only $19.80 fully assembled (wow).     The Teensy 3.1 is based on a Kinetis MCU chip from Freescale. The Kinetis boasts a 32-bit ARM Cortex-M4 processor core running at 72 MHz. The core in the Teensy features 256 KB of Flash and 64 KB of SRAM.   Of particular interest to us here is the fact that the Kinetis also has an eight-bit dynamic memory access (DMA) capability. This leads us to PJRC's OctoWS2811 display library , which works with Adafruit's NeoPixels and all other WS2811/2812-based addressable LEDs.   Using the Kinetis DMA capability, the OctoWS2811 can drive eight chains in parallel, which means it can update everything eight times faster. Minimal CPU impact and double buffering allows for complex animations that cannot be achieved using traditional Arduino-compatible platforms and libraries. Consider this video , which features 2,000 LEDs controlled by two Teensy controllers.     Did you notice my saying "minimal CPU impact?" This is actually really exciting. When you use the OctoWS2811 library to upload the data to your LED chains, the CPU hands control of this task over to the DMA engine without disabling any of the interrupts or anything like that. This leaves the CPU free to perform other tasks (like the FFT for my BADASS Display ).   Below we see videos of a few projects that have used the combination of Teensy boards and the OctoWS2811 library to drive thousands of LEDs to great effect. From top to bottom, these are the Wall of Light , the Penrose Triangle , the Skyline LED Wall Booth , and the CrashSpace Light Show .           Well, what can I say? I am very, very impressed. This certainly looks like a strong contender to drive a future incarnation of my BADASS Display. Also, Paul has been telling me about an amazing audio library he's been working on, but we will leave that for a future column. In the meantime, what do you think of the Teensy 3.1 and the OctoWS2811 library?
  • 热度 23
    2014-5-7 16:38
    1455 次阅读|
    0 个评论
    Good heavens! In Max's World (where the colors are brighter, the butterflies are bigger, the birds sing sweeter, and the beer is plentiful and cold), things are positively racing along. In my previous post on the Bodacious Acoustic Diagnostic Astoundingly Superior Spectromatic (BADASS) display, I described how I was starting out by creating a paper and cardboard prototype.     Well, I'm happy to report that the front panel is coming along in leaps and bounds. I've routed out the plywood (which will be stained to look like old wood) to accommodate the hardboard display and control panels (which will be painted to look like antique brass). In fact, I've been beavering away doing a whole bunch of things, all of which will be revealed in future columns. For the moment, however, I have a bit of a poser to ponder.   In order to give the whole thing more visual interest, the inner hardboard panels will be attached to the main plywood panel using brass acorn nuts. Also, each of the 256 tri-color NeoPixel LEDs in the main display area are going to have an associated brass surround.   Originally, I'd simply planned to use regular, flat brass washers, but then I started to think that these might be a tad boring and let the rest of the presentation down. Then, much to my surprise, I ran across some gorgeous countersunk brass washers as illustrated below:     Oooh! These look so tasty. I couldn’t resist them. But now I have a problem -- how am I going to attach them to the front panel? In order to understand the issues involved, let's first consider the cross-section shown below:     This is just a quick sketch I threw together in Visio, so it's not to scale. I've shown things as having sharp corners and suchlike. In reality, everything is sumptuously smooth and curvy. However, there are two problems (sad face). First, I have some thin sheets of translucent white plastic -- about the same thickness as a piece of paper -- which were kindly donated by my chum, Rick Curl. The image below shows a piece of white paper at the top overlaid by a sheet of this translucent white plastic film at the bottom.     Although it looks like you can see right through these sheets in the above image, they appear to be opaque when whatever is behind them is dark. My plan is to cut discs out of these sheets and stick them behind the central holes in the washers. The thing is, I don’t want to see any glue from the outside of the assembly as illustrated below:     The next problem will present itself when I attempt to glue the washer-film combo to the hardboard panel. Once again, I don’t want any glue to be visible from the outside of the assembly as illustrated below:     My concern is that -- although the wall of the brass washer is reasonably substantial with regard to its structural strength -- it's really rather thin when it comes to sticking it onto a flat surface. When we are talking about having 256 of these little rascals, we obviously want to have really solid bonds. The last thing I need is for them to be dropping off all of the time.   So, the bottom line is that I need some method for attaching disks of the translucent film to the inside of the washers, and for attaching the washers themselves to the main panel, all without seeing any glue, which would totally ruin the effect.   It probably won’t surprise you to hear that I already have a cunning plan. Indeed, it's a plan of such awe-inspiring cunning that we could pin a tail on it and call it a weasel (as the Black Adder would say in the UK television sitcom). However, it may well be that you have a plan that is even more cunning. If so, now would be an excellent opportunity for you to share it with the rest of us.