NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Other uses for the ledarray?

June 24, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

I've been trying for a week to get the array to work properly with no luck. What do you use your's for? I mean without the python-listener.py there's no way it'll load, i'm on windows. So is there another listener out there made by windows? If not it still makes a "not bad" light show.

June 24, 2009
by mcai8sh4
mcai8sh4's Avatar

There are other things you can do with the display - the sound level meter is one. You could also hard code other display things into it (your name, rude words erm... stuff). You could combine the real time clock with it, so you have one massive clock display (I've not really thought about this, but it should be do-able).

You should be able to get the python-listener to work in windows. I haven't tried it myself, but I'm sure it would work. I must admit, I had some problems with the python program, probably due to me knowing nothing about python, but it worked in the end.

I've modified the code to create two smaller programs that can be used with the display (well, other people told me what to do - I was clueless). Both work by just 'piping' the text you want displayed to the python program. For me, these smaller programs help me to understand how I'm communicating with the chip, as they only do one function. By using these progs from within shell scripts, I can output email status, log details... you get the picture.

Actually, it's been a while since I've used them, so unless I've altered them, they should work

This program displays static text on the screen :

#!/usr/bin/python
import serial
import sys
import time

serial = serial.Serial("/dev/ttyUSB0", 115200)
mystring = sys.stdin.readline()
serial.write('a')
serial.write('z')
serial.write(mystring)
time.sleep(5)
serial.write('z')
serial.write('\n');

This one displays the text in a scrolling fasion

#!/usr/bin/python
import serial
import sys

serial = serial.Serial("/dev/ttyUSB0", 115200)
mystring = sys.stdin.readline()
scrollMode = True
lastTime = ''
serial.write('b')
for data in mystring:
        if not data == '\n':
                    serial.write(data)
                    response = serial.read()
                    if not response == 'n':
                            print "Received: " + response
                            #This is a debug line, since I'm a bit fuzzy on some details
                            break
serial.write('a')

So whatever you call the programs (scroll_marquee), you can use them (in bash) like : echo "NERDKITS" | scroll_marquee

Both programs could easily be altered to take parameters from the command line, as in : scroll_marquee HELLO

Have a play, and see if you can get anything working, if you run into problems, shout out - I'm sure we'll get you up and running.

June 24, 2009
by Kevin
Kevin's Avatar

I have not been able to get the python listener to work in Windows either. Has anyone done this in windows? Any advice?

June 24, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Me and Humberto have been hashing this out for a while now. Humberto is working on it right now. There's a conflict between the two systems. This is what's happening on my end now. I've loaded both the ledarray2 and the servosquirter and now they won't load(again). This is typical of the problems. Initialload and the others won't load now either. They all come back with the same runtime error, contact the vendor. This is getting to be f**k it, this is just too nuts. Like I've got this down to a fine art but,why why why work once twice but not three times? Some thing in my "Window's" comp is hacking the shit out of these files and i don't have a clue what. But i think the guy's are going to half to write us windows guy's a listener that work's with windows.

June 27, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

http://www.flickr.com/photos/28711211@N07/3664853420/ (picture) I think this is definitely the far as i can go. I got past the syntax error. It's a long story if you want to know how i did it email me grant8of8@shaw.ca As for now after the syntax error it was missing py.serial that i found on the net. Then it was missing the win32file, that i also found on the net. I thought this is it it's going to load. When it came back with the missing dll i was finished. Not sure if it's missing another win32file or the imp.load_dynamic. Either or there not there. So i'm so close i can taste it. But still hungup. If anyone knows what the dll load is you can tell me i won't be mad. I alredy am. I added the echo and nc commands just to show they both work. Ready and waiting for the mysterious dll. Why am i looking all over for these components anyway like why aren't they included if their needed.

July 09, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Solution: Install Ubuntu. Took awhile to understand their end but now it's working. FJC

Post a Reply

Please log in to post a reply.

Did you know that interrupts can be used to trigger pieces of code when events happen? Learn more...