NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Project Help and Ideas » LED Marquee alternative
June 30, 2009 by mcai8sh4 |
Hello people... I've seen a few posts regarding the led marquee, mainly about some problems with the python listener. So here's a simple alternative. I've already posted two other python scripts - one displays scrolling text of piped data to the script, and the other displays static text piped to it - but alas, they've been wrote with Linux in mind. Since I don't have windows on this machine, I can't vouch for the usefulness of the following for you Windows people, but it's worth a try. I've been needing an excuse (for a year or so) to try my hand at perl.. this was the perfect excuse. I started learning pearl at ~5:30 today, it's now 11:50, so I'm proud of my achievement. Disclaimer : This is a work in progress - I dont know what I'm doing, but maybe someone with brains could elaborate/improve... So here's the script :
And thats it - there's bugs, but it seems to work. USEAGE : assuming the files named led-static.pl perl led-static.pl HELLO This will show 'HELLO' on the display for 5 seconds then should clear the display. It doesn't always work, sometimes the display isn't cleared and when you first turn on the nerdkit, you'll have to run the script twice for it to work (like I say I'm new to this). So, Windows people, install perl (can't help you with that yet - I've never done it) and you'll need Win32::SerialPort Then probably change the line
to
and it might work. I'm going to continue to learn this beast that is pearl, so if you can get it working let me know - I'll work on the scrolling display. I hope this is of some use to someone, but even if it's not, it's a good excuse to learn something new. I have to thank JB for helping debug and get this thing working, nice to meet you in the IRC channel (#nerdkits on freenode - shameless plug) - you were a great help! |
---|---|
July 01, 2009 by jbremnant |
Hey Steve, Glad to be help. It's good to see you made good progress! Hopefully I can also post something helpful for other people soon. :) The irc channel was a good idea. See you @ #nerdkits on irc.freenode.net (another shameless plug) |
July 01, 2009 by mcai8sh4 |
Oh, I forgot to mention the following two points. Windows guys - you'll have to alter "/dev/ttyUSB0" to whatever port you use! Everyone else - I know, I've spelt perl wrong on a couple of instances, ho-hum! If anyone gets this working on windows, let me know. Whilst it needs tweaking a little, I'm going to try to get a scrolling text working next - this is more useful. |
July 20, 2009 by mcai8sh4 |
I've made a little more progress regarding controlling the LED Marquee using perl instead of python. I now have 2 programs, one displays static text, the other displays scrolling text. The code for both is still very sloppy - but they seem to work ok. (once you've turned the LED Marquee on, you may have to run one of the progs twice, whilst it gets into the correct mode - but after that... all good) Feel free to improve, play, ask, whatever. |
July 20, 2009 by mcai8sh4 |
ok just noticed a stupid error. On the scrolling text program (around line 34) - its better to use :
I was struggling to get that bit working, but the input version seems to be better. |
July 20, 2009 by jbremnant |
Good stuff mcai! I also have some code/etc to share, but will post the details when I get the chance. If anyone's interested, I've modified the ledarray project:
It's hooked up to my linux box at work to alert me when crap hits the fan. :-) It turns out arduino is quite compatible with nerdkit and its build chain. One thing I don't like about arduino, however, is that it puts too much reliance on the IDE for development, and the "sketches" you end up creating are too abstracted out from the real MCU programming experience. I very much prefer nerdkit's approach. Teach the real tools and the underlying avr-lib to build the projects instead of writing "sketches". Besides, arduino tools on linux was somewhat broken. I'd recommend arduino as complimentary hardware option, since it does use the same MCU and couple of nice features that nerdkit doesn't have yet. But as far as education is concerned, I'd say stick with the nerdkit. |
July 21, 2009 by mcai8sh4 |
Ok you Windows folks... it all works for you guys too. Quite simple! So if you want to run your LED Marquee from Windows and are having trouble with python, here's the perl alternative. I have just done the following myself and it all works, I don't use Windows as a rule, but this worked for Vista. If you have any problems, let me know (might not be able to help, but I'll try). First you need to download Active Perl from here : Active Perl It's free and around 17MB Once you have that install it and check all works by typing (on the command line)
if you see stuff other than an error, then it works!! You'll then need my little scripts AND the Win32::Serialport package - I've put all the files into a zip to make life easier for you. You can get the files here : STUFF unzip these into somewhere you plan to run the code from (remember these scripts are to be run on the command prompt). Once thats done you have to install the serial port package, this is quite simple. First open your command prompt and navigate to where you unzipped the files, then change directory to the "Serialport-0.19" directory. At this point I connected the nerdkit to my computer (and I turned the LED marquee on - not sure if I had to, but I did). I checked what com port I was using for the nerdkit - it was port "COM3" Next type something along the lines of : (alter to use your port) Type one line at a time!
You'll see stuff on the screen. It does tests and things - I had a lot of fails, but no need to worry. This took about 30 sec. The I think I rebooted (might not be needed). Thats it!! Your ready to test. If your Nerdkit doesn't use COM3 - edit the files and alter the line :
Connect your LED Marquee up to the computer and turn that bad boy on! Go to the dir that the led-scroll.pl/led-static.pl are in and type the following :
and you will see.... nothing (this always happens first time... I'm working on it). Type the above line again, then you should see "HELLO" displayed for 5 seconds. If that works, next we'll do a scrolling display. Same as before but with the other script :
"HELLO" should scroll across your marquee!! If it works, pat yourself on the back (and buy me a beer) Whilst these programs work - they're not great, there are a few funny things that happen occasionally, but if it goes wrong, run the command again and it seems to sort itself out. "But Mr.Mcai8sh4, I want to pipe my text to the display, make it do that!" - One step ahead of you young Grasshopper, edit the program and remove the "#" at the beginning of the line
Then you can pass the text to the prog something along the lines of :
now you can have program outputs sent to the display (use batch scripts... whatever) Play around, have fun. If you do have problems, I'll try to help - but windows isn't my territory - so no guarantees. DISCLAIMER : if following these instructions messes up your computer in some way - not my fault - I will be sincerely sorry, but still not to blame. |
Please log in to post a reply.
Did you know that there are Power MOSFETs for switching big loads on and off? Learn more...
|