C++ to python for LED Matrix

This is the place for queries that don't fit in any of the other categories.

C++ to python for LED Matrix

Postby limko » Sat Feb 01, 2014 10:22 am

Hey folks,

So the last week or so I've been searching this site for information on how to control and program a LED Matrix (or a number of them) for a project. A few Topics have caught my eye, with me originally having in mind using a Maxim MAX7221 to control the matrix, but none more than Klaas's: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=41713.
This was almost perfect for me, until I saw the code was in C++ and from the title all I know is Python. So after checking the code out and trying to figure how this language works I just couldn't break it down and Unfortunately I don't have a lot of time to learn C++ ( would be great if I could but I don't have that luxury right now).
So if anyone is willing to check Klaas's topic and code and convert it into python that would be awesome, even if someone would explain how the code is working that would be great, oh and don't be scared to comment on ways of going about this project.

Note: Hoping I could achieve something like this but with the Pi: http://www.youtube.com/watch?v=FzHT-L-7jIA


Lknott :-D
Last edited by Mekire on Sat Feb 01, 2014 10:36 am, edited 1 time in total.
Reason: First post lock.
Posts: 1
Joined: Sat Feb 01, 2014 10:16 am

Re: C++ to python for LED Matrix

Postby metulburr » Sat Feb 01, 2014 12:57 pm

I dont know about other people, but i dont have the incentive to sit there and convert a few hundred lines of c++ to python. At least if its not for my own benefit. Maybe if you offered a payment. Its probably your disinterest in learning c++ that turns me off from the whole thing. However if you start the process, and come along a problem, im sure any one of us would be happy to help.
Jesus wrote:give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime
we will be moving to python-forum.io on October 1 2016
more details here
User avatar
Posts: 2244
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: C++ to python for LED Matrix

Postby micseydel » Sun Feb 02, 2014 10:53 pm

metulburr wrote:
Jesus wrote:give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime


+1 to the idea of helping you accomplish the conversion yourself though, and I do have a bit more advice for that. At work I code in Java, but had to retire an old Ruby project after converting it to Java. I didn't know Ruby, and still don't. But I was able to read enough of it to be able to replicate it, especially since it was live, working code that I could run and test. I even on occasion had to update the old project while working on the replacement, since when things broke it couldn't wait months for the replacement, it needed it immediately. So I even made a small number of updates to this code base in a language I didn't and don't know.

Your situation is similar. Presumably you can get the C++ working, but can't make the changes you'd like to. It should be possible for you to, admittedly with some effort, convert it C++ since you'll have the ability to experiment a great deal. I recommend you put your converted code on Github, and whenever you ask us a question, reference the smallest amount of C++ you're having trouble converting, your attempt at converting it to Python (both in code tags here) and then a link to your Github so that if we need to we can see the larger picture and you won't be accused of being lazy or anything.

Just my two cents.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: C++ to python for LED Matrix

Postby Tcll » Mon Feb 03, 2014 4:09 am

just for my input... I personally learn better from working, well commented examples, rather than tutorials or documentation...
most writers of this stuff can't seem to grasp the concept of visual learning, which helps out greatly when you're trying to learn something quickly...

my best advice... (from someone with the same issues)
google what specific parts of codes are, and then try to make the logical connections on what they do...

if you need a fall-back guy on pointers, I've pretty much nearly completed a virtual pointer system for file data:

Code: Select all
int value
short *ptr

value = bu32() // 6

ptr = &value

*ptr = 28 // not sure if 'value' is still an int or is now a short >.>

cout( value ) // should return 28 ( short or int?? )

Code: Select all
value = bu32() # 6

ptr = ref( value )

deref( ptr, bu16 ).set( 28 )

print value # outputs 28 as a bu16 type.

the interface is highly unfinished, but if you're interested, you can check out my UMC dev5 repo. (ask me for the link) ;)
User avatar
Posts: 107
Joined: Wed Jan 01, 2014 6:36 pm

Return to General Coding Help

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests