Follow this guide to get going with I2C on the Raspberry and Python.
For the Raspberry Pi I got a Slice of Pie add on board which makes the physical connection easier. I attached the SAA1064 directly to the onboard 5V powersupply. This works, but is probably deprecated since it may draw more power than the specs for the Raspi recommend. 7 Segments * 4 Digitis * 3 mA minimum @ 5V = a bit less than 500mW. So maybe you might want a seperate power supply to be on the save side.
I am not a python programmer, I guess this is probably m first python script ever so it's probably a bit clumsy. I am impressed by the simplicity how everything comes together. Of course, the possibilities of a four digit 7 segment display are not unlimited, but it's just cool ...
The following script is installed as a cronjob
sudo crontab -e
and add the following line (change it to your path)
* * * * * python /home/pi/7seg.py
save
the script will be executed once every minute. And as it is once a minute means pretty much exactly when the seconds hit 60. (Of course, this is not suitable for real time applications, bu who cares if the display has a an update jitter of a few 10 to 100 millisecs)
Add the Hex-Codes of the Lines to get the corrsponding Hex number of a char.
Two things to mention:
- Don't get confused by the adress 0x38. This equals to 0x70 without the LSB.
- the variable cmd refers to page 6 (subadressig) of the datasheet
________________________
7seg.py
________________________