ThunderBorg on python3

Hello,
When I run one of the examples, which uses python2, it finds the board and outputs

Loading ThunderBorg on bus 1, address 15
Found ThunderBorg at 15
ThunderBorg loaded on bus 1

But, when I ran the ThunderBorg.py file through the 2to3 translator, imported it into a python3 script, and ran it, it outputs:

Loading ThunderBorg on bus 1, address 15
Missing ThunderBorg at 15
ThunderBorg was not found
Are you sure your ThunderBorg is properly attached, the correct address is used, and the I2C drivers are running?
Scanning I�C bus #1
No ThunderBorg boards found, is bus #1 correct (should be 0 for Rev 1, 1 for Rev 2)
No ThunderBorg was found

This is on the same pi, one after the other. Is there a version of the ThunderBorg.py file which works with python3?

Thanks,
Michael

piborg's picture

We do have a version of the script for Python 3 :)

You can download it here: http://old.piborg.org/downloads/thunderborg/ThunderBorg3.py.txt

Alternatively download directly to your Pi using:

cd ~/thunderborg
wget -O ThunderBorg3.py http://old.piborg.org/downloads/thunderborg/ThunderBorg3.py.txt

You can then change your scripts from:

import ThunderBorg

to

import ThunderBorg3 as ThunderBorg

Thanks for your quick reply, it works perfectly now.
Unfortunately, I didn't know you'd replied until now, so I got it working on my own beforehand. I've changed it to using the script you provided, as that seemed best.
Sorry for the late reply, I thought I'd get an email when I had a reply, and I should have kept checking.

piborg's picture

Sorry about that, the forum is supposed to send emails but we have been having some trouble with the system recently :(

We are hoping to have everything fixed and back to normal soon.

You guys still have that python3 script lying around somewhere? That link above doesn't seem to exist anymore.

piborg's picture

The script is still available, the URL has just been changed :)

You can download it here: http://old.piborg.org/downloads/thunderborg/ThunderBorg3.py.txt

Alternatively download directly to your Pi using:

cd ~/thunderborg
wget -O ThunderBorg3.py http://old.piborg.org/downloads/thunderborg/ThunderBorg3.py.txt

I have updated the earlier post as well for anyone else looking.

Awesome, thanks for the fast reply!

Subscribe to Comments for "ThunderBorg on python3"