topherCantrell/EROLEDM0321

upgrade to Python 3 issues

Closed this issue · 3 comments

been using this code to drive a display for Moode Audio. It's been rock solid thank you.

the latest version of Moode seems to be getting rid of more and more of the Python 2 reliance which I can understand. It has however thrown up some errors now in using this code. If anyone can help will be very happy otherwise I may have to look at other ways of using this great display which I do want to do.
error is:

Traceback (most recent call last):
  File "/var/local/www/commandw/lcd_updater.py", line 79, in <module>
    oled = OLED()
  File "/var/local/www/commandw/OLED.py", line 78, in __init__
    self.Clear_ram()
  File "/var/local/www/commandw/OLED.py", line 109, in Clear_ram
    for y in xrange(128):
NameError: name 'xrange' is not defined

re-pulled the repo and made some local adjustments and now works. I should read your change log more carefully! that's holidays for you!

I made the changes to "print" and "xrange" and merged them through. I don't have hardware setup here, so keep me posted!