NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Ideas for coding LED array streaming?
December 04, 2009 by Haprog |
Any ideas for good ways to implement receiving streaming animation on the NerdKits LED array? I thought I could start by modifying the do_scrolling_display() function for receiving individual LED on/off data. Anyone done this? |
---|---|
December 04, 2009 by Rick_S |
I've made quite a few different effects with text on the array. Most of which is posted in the forum here. The ledarray_set function you'll find in your ledarray.c program sets individual led's. If you come up with more interesting ways to use the display, please update us. New code helps us all learn. Rick |
December 04, 2009 by mcai8sh4 |
Haprog : Sorry to repeat, but it's always better to post ideas here so everyone gets them. For those who may be confused - Haprog and I have just had a quick chat on the IRC channel about this, so here's a plan. A (potentially) simple idea would be to send 24 integers (between 0 - 5) and store them in the array la_data, then display, the get the next 'frame'..... So using the basic idea of sending text - send a char, wait for 'send next char' thingy, send next char.... we just do the same, but with numbers. Those numbers are then stored in the array and it should work. I have a hell of a schedule at present, but I'm going to do some simple tests when I get a bit of spare time to test this theory. Rick : from reading (and really enjoying) you posts detailing your progression with the display - I think you'll know instantly if I'm going down the right path or not :) Just my initial thought on the subject. -Steve |
December 04, 2009 by Rick_S |
I haven't tried messing with the main array directly. Right now my display is dedicated for the holiday. A direct manipulation of the array data was in my mind when I was thinking of shifting text on the display from the top down or bottom up as a whole word. Also some of the other suggestions I had for curtain wipes to display text or clear the screen would probably benefit from this type of updating. I probably won't mess around with it much until after the holidays. I'm also going to look into the use of shift registers to control the column data. If this works, it could open the display to be much larger with less pins used on the controller. New more interesting stuff will be coming (hopefully at least) if I can get it all going. I have bought some more LED's so who knows, maybe I'll get ambitious and build another display. :D Rick |
December 05, 2009 by Haprog |
Rick: Sounds great. It would be awesome to be able to control more LEDs with less pins. Keep me updated about that. I would definitely want build a bigger LED display at some point or maybe use a few pins for something else on the same breadboard. We should start a new thread on this if something comes up. Actually I even figured out one way to increase the number of LEDs myself. Instead of using the 17 pins for 12 column and 5 row wires (12x5x2 = 120 LEDs) we could wire the LEDs as a grid of 9 column and 8 row wires to get an 18x8 display of 144 LEDs using the same 17 pins on the MCU. That's 24 LEDs more. We could then physically align the LEDs as a grid of 36x4, 24x6, 18x8, 16x9 or 12x12. Or if you don't mind wasting a few potential LEDs you can get a 28x5, 20x7, 14x10 or 13x11 grid. Though the physical wiring will require some planning as the row and column wires won't be going straight unless you do the 16x8 grid. And ofcourse this would also require a special addressing method in code to map the physical LED positions to the wired 9 column 8 row grid depending on how you wired the LEDs. This might be a bit too much trouble to go through for only 24 LEDs though. |
December 05, 2009 by Rick_S |
Wow, it seems our minds are on similar tracks. I had thought of converting 2 column wires to rows creating a 7 x 10 or 140 led's. My main thought was making better looking fonts with the added pixel height. I hadn't really thought of trying to address them other than 7x10 though. To try to use some of the row pixels as column pixels seems a bit overwhelming to me. Keep in mind... While I'm a 44yr old electronics/computer nut who has played with electronics and computers since the early 80's, my main exposure to C has been just over the past couple of months since I purchased my NerdKit. Sure, I dabbled a bit in C but never really got any farther than "Wow this is different". I'm just now starting to get my head around it to where it's starting to click. It took me a good week of studying the code for the ledarray to understand it well enough to make the mods and add the functions I did. So believe me when I say this is a learning experience for me as well. I know the NerdKits guys are looking into expansion of the array as well... so who knows what the future will bring... |
December 05, 2009 by Haprog |
I also thought I could at some point consider making a way bigger LED array controlled by more than one MCUs (or MCU + some other devices?). I don't actually know much about electronics yet though I'm trying to learn with my new NerdKit. I might as well tell something about myself also. I'm a 22 year old computer science student at the University of Turku, Finland. I had my first personal HTML website around 1998 when I was about 11. About a year later I started programming as a hobby. First I programmed with Delphi (Object Pascal) for many years. I also started playing around with PHP+MySQL for the web around 2001 and have been doing those since then. I've tried simple things in many other languages. Lately I've also tried some Python and studied Java. I've also been working as a Software Designer making database applications for the web for some years now. |
December 05, 2009 by Rick_S |
My main experiences in programming was with BASIC of the 80's (GW-Basic, Quick-Basic, Visual Basic for DOS). I looked at Pascal, and C But hadn't touched any of them until about a year ago when I discovered micro-controllers. I also discovered they could be programmed with my old friend (BASIC) through the BASCOM (basic compiler) for micro-controllers. I've messed around with that as well as various projects until I decided it's time to try a more advanced language again. Thus my interest in the NerdKit. My hope was that through it I could finally begin to grasp C. Much to the dismay of my wife (due to the many hours I've spent), It's begun to click. I still have a VERY long way to go but I'm at least on the path. One thing I can't seem to get my head around is how much I could seemingly program with the 4K limited demo of bascom vs C. I have several different micro-controllers.
ATTiny2313's, ATMega8's, ATmega128, ATMega168's, and ATMega328p's. I have difficulty fitting what I think should be a simple program into a mega8. For instance the temperature program. I know I could program that in bascom and fit it whithin the 4K limitation of the demo. I can't seem to get C to compile it small enough to fit in the 8K the chip has?? Oh well, as I said, I have a LOT to learn. As for you, it sounds like you are well on your way to a good and enjoyable career. Just remember, NEVER stop learning. It will keep you ahead of all competition!! |
December 05, 2009 by Haprog |
Ofcourse. There are so many things one needs to know to become truely successful in this career. Different languages (markup, programming, modeling) and tools, version control systems (centralized and distributed), object oriented and agile methods, design principles and patterns, SQL and "NoSQL" databases, cloud platforms etc. And all relevant technologies and methods evolve continuously at a rapid pace. I'm trying to keep up with web development techniques by being subscribed to dozens of related RSS/Atom feeds (websites, blogs, YouTube channels) and following certain people and entities on Twitter. :) |
December 05, 2009 by Haprog |
I came up with a big idea. I started defining a new protocol for defining and streaming LED array animations (with minimalistic footprint bit-wise). (Or more generally binary array/matrix animations.) The basic idea is that you can define command sequences that can be either streamed from PC or they can be stored on the MCU so you can have custom animation when the NerdKit isn't connected to a PC. The stored animations (command sequences) can be written (and read) through serial connection without reprogramming the MCU. This is my plan so far:
I think this could be awesome but there's a lot of coding to do. Any comments or ideas? |
Please log in to post a reply.
Did you know that using an alternating excitation voltage can reduce the noise in many sensor measurements? Learn more...
|