Closed GeekyTim closed 2 years ago
@GeekyTim This issue occurs because your PiHut status HAT pins match the onboard OLED display pins, which is why the display works normally after removing the hat. If you wish to run this HAT, please do not utilize the onboard OLED display pins; instead, remark below lines and lines relating to OLED.-
i2c = I2C(1,freq=200000,sda=Pin(6),scl=Pin(7)) print(i2c) print("I2C Address : "+hex(i2c.scan()[0]).upper()) # Display device address print("I2C Configuration: "+str(i2c))
oled = SSD1306_I2C(WIDTH, HEIGHT, i2c) # Init oled display oled.fill(0) oled.text("Client",30,0) oled.show()
Ah! Lots to learn.
I've just plugged my first hat on top of the PiSquare having got a Pi and PS communicating. However, when I run the same PiSquare software example (pisquare_client.py) it no longer connects:
I2C(1, freq=200000, scl=7, sda=6) Traceback (most recent call last): File "", line 20, in
IndexError: list index out of range
(the line is print("I2C Address : " + hex(i2c.scan()[0]).upper()) # Display device address)
I've not yet worked out why this is happening, but works perfectly when no HAT is attached.
Any thoughts?