Forum Index > Projects > LED Pegboard and Matrix Projects
 Convert a bitmap file to a Peggy2 program
 |  Printable Version
By: Mickey (offline) on Sunday, October 18 2009 @ 08:50 AM PDT (Read 5885 times)  
Mickey

A new program has been uploaded to the google code repository that converts a bitmap file to a Peggy2 program. No programming necessary!

http://code.google.com/p/peggy/downloads/list


Forum Henchperson
Henchperson


Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   
By: Windell (offline) on Monday, October 19 2009 @ 05:13 PM PDT  
Windell

Mickey,
Neat idea! Any way to pull out the DOS-dependent library ( conio.h ) to make it gcc compatible?


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Mickey (offline) on Monday, October 19 2009 @ 05:56 PM PDT  
Mickey

Absolutely. Just remove the include and the one call to _getch(). I only added it so that if Windows users double-click on the app, it displays the quick ref and waits for a keystroke instead of flashing a command window and disappearing.


Forum Henchperson
Henchperson

Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   
By: Windell (offline) on Monday, October 19 2009 @ 06:17 PM PDT  
Windell

Okay-- I got it to compile and execute, but there seems to be some additional platform dependence here. Trying it with the syntax in the readme, I get the error "Incorrect Format, File: Einstein.bmp"

Removing that check traps at "Unsupported Format," so it looks like there are deeper issues.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Mickey (offline) on Monday, October 19 2009 @ 06:27 PM PDT  
Mickey

Hmm. Could be integer sizes or structure alignment. I thought that #pragma pack(2) was gcc compatible. I will find a Linux VM and see what I can do. It works in Windows, but I should have known the Arduino crowd were Linux fans!


Forum Henchperson
Henchperson

Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   
By: Mickey (offline) on Tuesday, October 20 2009 @ 08:33 AM PDT  
Mickey

Windell,
I got it to run just fine. This is what I did:
* Downloaded a Linux ISO and installed a VM
* Removed the include of <conio.h> and the _getch(); line from bmp2peg.c
* Uploaded bmp2peg.c, bmp.h and einstein.bmp to the VM
* Typed "gcc bmp2peg.c -o bmp2peg"
* Typed "bmp2peg einstein.bmp"
* And, presto - the program worked and displayed the Peggy program.

This was the first time I have used Linux, but the process seemed pretty straightforward. Please let me know if you are still having trouble getting it to run.

-Mark


Forum Henchperson
Henchperson

Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   
By: Windell (offline) on Tuesday, October 20 2009 @ 12:05 PM PDT  
Windell

Hmmm... Maybe I'll have to try this on Linux, then...


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Mickey (offline) on Tuesday, October 20 2009 @ 01:32 PM PDT  
Mickey

Oh, are you on a Mac? Maybe the OS added a Mac resource fork to the file that my program is not expecting. Can you send me the exact file as it is on your machine so I can code around the issue (if indeed that is the issue)?


Forum Henchperson
Henchperson

Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   
By: Windell (offline) on Wednesday, October 21 2009 @ 05:21 AM PDT  
Windell

Yes, able to run this fine on Linux.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Mickey (offline) on Tuesday, October 27 2009 @ 02:16 PM PDT  
Mickey

I was actually able to compile and run it on a Mac. I uploaded an updated version that has instructions for Linux and Mac users. It also includes a Mac executable. It was compiled on OS X 10.4/Tiger, but I think it should run on all OS X Macs.

By the way, thanks for mentioning me and bmp2peg in your blog!


Forum Henchperson
Henchperson

Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   
By: Anonymous: Chris () on Monday, July 11 2011 @ 07:03 PM PDT  
Anonymous: Chris

I am not sure if this has anything to do with what your talking about but i am on a PC and i cant get this to work to save my life! i have the .bmp ready an everything and i type in the code like you put in your example but i put in the name of my file and it says there is a syntax error. any ideas? I have tried everything i can think of. I am new to Command Prompt so any help would be great.





       
   
By: Mickey (offline) on Tuesday, July 12 2011 @ 05:05 AM PDT  
Mickey

Chris, Can you post the exact command line you are typing and the exact error you are getting?


Forum Henchperson
Henchperson

Status: offline

Registered: 10/13/09
Posts: 15

Profile Email    
   



 All times are PDT. The time is now 03:10 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?