print("Let's make OLED Display sentences")
print("Date: 18/4/2024")
print("By: Danial Hafiz bin ABdullah")
#Import all Libraries/modules
import oled_library #This is oled_library
from machine import Pin, SoftI2C
#Pin Declaration
oled_pin = SoftI2C(scl=Pin(22), sda=Pin (21))
#Parameter Declaration
#Create an OBJECT name for module with library
# OBJECT name = library name.class name ()
skrin = oled_library.SSD1306_I2C(width=128, height=64, i2c=oled_pin)
#Main Program
#By default color code is white (1)
skrin.fill(0)
skrin.text ("Hello everyone!", 4, 10, 1)
skrin.text ("Nice to know you!", 4, 20, 1)
skrin.show()Loading
esp32-devkit-v1
esp32-devkit-v1