print("Hello, ESP32!")
print("Hello, This program is to detect motion from PIR sensor!")
print("Date 21/11/2023")
print("By: Muhd Asyraaf ")
# import all necessary libraries
from machine import Pin, SoftI2C
import SSD1306 #This is OLED library
# pin declaration
I2c_oled = SoftI2C(scl=Pin(22), sda=Pin(21))
oled_width = 128
oled_height = 64
# Let's Create OLED as an OBJECT
oled = SSD1306.SSD1306_I2C(width=oled_width, height=oled_height, i2c=I2c_oled) # library name.class name ()
# Main program
# 1 is code for white, 0 is code for Black
oled.fill(1)
oled.text( "SUSAH GILA OLED", 5, 10, 0) # Text, column, row, colour mode
oled.text( " ASLM REAL KE NI?", 0,25,0)
oled.text( " HAHAHAHAHAHH", 5, 50, 0)
oled.show()