Hello, for my project i want to display my result on a OLED screen.The oled i am using is Adafruit SSD1306.i tried interfacing OLED using the arduino pins provided in the board. And i am using arduino groove oled library from the pynq libraries. The SCL pin in OLED is connected to the SCL pin in board and similarly SDA pin in OLED is connected to the SDA pin in the board.
Code:
from pynq.overlays.base import BaseOverlay
from pynq.lib.arduino.arduino_grove_oled import Grove_OLED
Load the base overlay
ol = BaseOverlay(‘base.bit’)
Initialize the Grove OLED display
oled = Grove_OLED(ol.ARDUINO,[13,14])
Clear the OLED screen
oled.clear()
Set the display mode to normal
oled.set_normal_mode()
Set the position of the display
oled.set_position(0, 0)
Set the contrast level
oled.set_contrast(100) # Adjust the brightness as needed
Write text to the OLED screen
oled.write(“Hello, PYNQ!”)
Display other text or graphics
oled.clear()
oled.write(“New Text”)
Don’t forget to close the connection when done
oled.close()
But i am getting an error as :
/usr/local/lib/python3.6/dist-packages/pynq/lib/arduino/arduino_grove_oled.py in init(self, mb_info, gr_pin)
83 “”"
84 if gr_pin not in [ARDUINO_GROVE_I2C]:
—> 85 raise ValueError(“Group number can only be I2C.”)
86
87 self.microblaze = Arduino(mb_info, ARDUINO_GROVE_OLED_PROGRAM)
ValueError: Group number can only be I2C.
Is my code correct?If not,how can I rectifiy the error?