The code we are about to explore is contained in the chapter08/oled_cpu_temp.py file. Please review this file to get an overall view of what it contains before continuing:
- If the OLED I2C address you obtained in the preceding was different to 0x3C, find the following line in the source code and update the address parameter to match your OLED I2C address:
serial = i2c(port=1, address=0x3C)
- Run the program, and you should observe the CPU temperature and a thermometer icon drawn on the OLED display.
Once you have configured your OLED display address in code and confirmed the example works on your OLED, we are ready to review the code and learn how it works.