pmod_oled


Displaying text on a PmodOLED

This demonstration shows how to display text on a PmodOLED using the Pynq-Z1 board.

The Digilent Pmod OLED is required. In this example it should be connected to PMODA.


In [1]:
from pynq import Overlay
from pynq.iop import Pmod_OLED
from pynq.iop import PMODA

ol = Overlay("base.bit")
ol.download()

pmod_oled = Pmod_OLED(PMODA)

In [2]:
pmod_oled.clear()
pmod_oled.write('Welcome to the\nPynq-Z1 board!')

You should now see the text output on the OLED, so let's try another message


In [3]:
pmod_oled.clear()
pmod_oled.write('Python and Zynq\nproductivity &  performance')

Finally, capture some text from IPython shell calls and print out to OLED


In [4]:
def get_ip_address():
    ipaddr_slist = !hostname -I
    ipaddr = (ipaddr_slist.s).split(" ")[0]
    return str(ipaddr)

pmod_oled.clear()
pmod_oled.write(get_ip_address())