loading

This project is a follow-up project of my previous Instructable called IoT RPi LED Message Board. I am a facilitator for a local Girls Who Code club and I wanted a simple yet fun tool to teach students on how to convert from bitmap/binary to decimal and hexadecimal.

Please follow Steps 1 and 2 on IoT RPi LED Message Board to configure RPi. We'll be using the same setup as my previous project except for the new ZeroMQ server code that uses a different max7219 function to draw pixels column by column (or row by row if you rotate the LED matrix 90 degree clockwise.)

Step 1: ZeroMQ Server

Download the attached max7219_set_byte.py code to your home directory.

Run it as root:

sudo python max7219_set_byte.py

Now the ZeroMQ server is ready to receive row values in decimal from the web page.

If you want to shutdown the server, just do Control-C to exit the server screen.

Step 2: Web Page

Download the attached led_pixel.tar.gz file to the Apache root or sub-directory.

Untar it:

tar -xzvf led_pixel.tar.gz 

This creates following files:

pixel.py                             (main program)
./templates/interstitial.html (page template)
./templates/send_pixel.html (page template)
./static/img/led_matrix_bitmap.jpg (jpg used in page template)

You may have to change permissions on these files to allow read and execute (only for *.py) by Apache.

Now, enter the URL for pixel.py on your browser and make sure the web page comes up (see photo).

You could test it by entering decimal values of a drawing. For example, if you want to draw the space invader shown on the web page, enter:

24     (....because first row's bitmap is 00011000 and this translates to 24 in decimal)
60
126
219
255
36
90
165

(Note: If you need help with binary to decimal conversion, google it or see http://www.wikihow.com/Convert-from-Binary-to-Deci...)

Click on Submit. If everything is setup correctly and ZeroMQ server is running, this should display that space invader on the LED matrix.

Click on Hexadecimal radio button and submit your drawing in hexadecimal. If you want to draw the space invader shown on the web page, enter:

18
3C
7E
DB
FF
24
5A
A5

Click on Submit. This should display the same space invader on the LED matrix. If you need a tutorial on binary to hex conversion, google it or see http://www.wikihow.com/Convert-Binary-to-Hexadecim...

Now come up with your own cool 8x8 drawing but you must learn how to convert bitmap/binary to decimal or hexadecimal!

About This Instructable

625views

5favorites

License:

Bio: My goal is to captivate, inspire and engage young engineers through intriguing robotics projects. I use Arduino at my robotics workshops since it is the ... More »
More by botdemy:MicroPython IoT Rover Based on WEMOS D1 (ESP-8266EX) Pet Bot (no Coding) Billboard Bot 
Add instructable to: