Monochron source -- segmenter.py

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Algolosaur
 
Posts: 67
Joined: Sun Apr 05, 2009 11:29 am

Monochron source -- segmenter.py

Post by Algolosaur »

I found this file in the digits subdirectory, and I am at a loss as to how to make it work. Trying the obvious approach, I get this error:
Traceback (most recent call last):
File "segmenter.py", line 1, in <module>
import Image
ImportError: No module named Image
Going over to python.org didn't find anything promising for the "Image" module, so assuming it was a distribution built-in, I downloaded and installed Python 2.7, which gets identical results.

Using "make" on the Adafruit code from github builds apparently identical hex files, and there is no sign the digits directory is ever touched.

I have located a Processing sketch that came as part of the ks0108 library:
ks0108/Processing/glcdBitmap/glcdBitmap.pde

This would appear to serve the same purpose as "segmenter.py".

Can anyone confirm this, or tell an old Algolosaur how to make segmenter.py work on a PPC Macintosh running Tiger?

Algolosaur

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Monochron source -- segmenter.py

Post by adafruit »

theres a python Image library - google didnt help?

Algolosaur
 
Posts: 67
Joined: Sun Apr 05, 2009 11:29 am

Re: Monochron source -- segmenter.py

Post by Algolosaur »

The pythonware offering?

http://www.pythonware.com/products/pil/

Looks like I'll have to muck with source for that. Ah well, I haven't been having enough fun of late...


Algolosaur

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Monochron source -- segmenter.py

Post by adafruit »

it should Just Work (?)

Algolosaur
 
Posts: 67
Joined: Sun Apr 05, 2009 11:29 am

Re: Monochron source -- segmenter.py

Post by Algolosaur »

One may hope. All the builds they offer are for Windows and Python older than 2.7.

I have Mac and just installed Python 2.7.

Still, as I noted, it doesn't seem to be being run as part of the Monochron build, and there is a possibly equivalent Processing program available.

Worst case, I can convert my bitmaps by hand. It won't be the first time. Or the tenth.


Algolosaur

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Monochron source -- segmenter.py

Post by adafruit »

we run 2.5 and like it :)

Algolosaur
 
Posts: 67
Joined: Sun Apr 05, 2009 11:29 am

Re: Monochron source -- segmenter.py

Post by Algolosaur »

I suppose I should say how things turned out.

Building the Pythonware image library was essentially a matter of following the directions after remembering the local rules of the game. [Rule 1: Users can't sudo, Rule 2: Administrators are banned from user file access]. Round one crashed trying to install after building the library, and evasive tactics (using "sudo cd" to get back into the build directory to do the install) were invoked.

So, now segmenter.py will produce the quaint numbers found in the rle.c file which would be a run length encoding of the .bmp files.

The Processing sketch I had found produces .h files containing bitmaps, which are not at all the same thing. Still, either program looks to be useable as a base to implement the functionality of the other, and both are useful in their own right.


Algolosaur

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”