print("This program will make OLED operate")
print("Date: 18/4/2024")
print("By: IHH")
#import library or module
from machine import Pin, SoftI2C
import Library_OLED
#pin declaration
oled_pin = SoftI2C(scl=Pin(22), sda=Pin(21))
#parameter declaration
#create an object name for sensor with library
#Object name = library_name.class_name(.......)
display = Library_OLED.SSD1306_I2C(width=128, height=64, i2c=oled_pin, external_vcc=False)
#main program
#colour code 0 = black, 1 = white
display.fill(1)
display.text('Hello...', x=5, y=20, col=0)
display.text('Izzat Haziq Hazrin', x=5, y=30, col=0)
display.text('18/4/2024', x=5, y=40, col=0)
display.show()
Loading
esp32-devkit-v1
esp32-devkit-v1