Pages: [1]   Go Down
Author Topic: Help to convert a arduino libarary to python  (Read 603 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I purchased some  LCD 7 segment displays.  The vendor was able to give me some lib's but they were for the arduino, I am wondering if there was a kind soul that would mentor me though the process of converting the libs to python.

thanks

Brad
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am wondering if there was a kind soul that would mentor me though the process of converting the libs to python.
Are you running python on your Arduino? I'd be amazed if you were.
Logged

Offline Offline
Edison Member
*
Karma: 32
Posts: 1387
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For hardware intensive stuff like this, it is generally better just to write your own. It is difficult for us to help you since all the action takes place where you make the hardware calls to control the segments. And we have no idea how to do that on your python machine.
Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1072
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is this for, Raspberry Pi?  There are C to Python converters such as http://www.catb.org/esr/ctopy/.  But you have to understand that these convert C to Python, not a bunch of non-standard Arduino library calls in C to functionally equivalent library calls in whatever Raspberry Pi's extensions to Python are.  It can't do that.  It doesn't try to handle the architectural differences between the Arduino and the Raspberry Pi because it doesn't even know what they underlying platforms are.
Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Rome, Italy
Offline Offline
Sr. Member
****
Karma: 20
Posts: 442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It may vary depending on your device, but I guess that these libraries send messages over a bus to the device, using a certain protocol. Sometimes the protocol is just software, implemented by reading and writing over a serial connection using OS calls, but sometimes hardware-related signals are involved (as when you need drivers to communicate with a device).
Reading the libraries' code should tell you something, probably a lot, about the protocol used. Then you may find a python implementation for that protocol and start coding without bothering about the Arduino stuff. Porting code from Arduino-C to Python seems like a bad idea because some features may depend on the hardware.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been hacking my way through the code. I found another simple lib for the lcd still for the arduino but stripped down so I am able to hack my way through.  Should be interesting to see how it works when I run it.

thanks

Brad
Logged

Pages: [1]   Go Up
Jump to: