View Categories

LCD 1602 I2C Display Ke Raspberry Pi Pico

Persiapan Bahan #

– Raspberry Pi Pico / Pico W
– LCD 1602 With I2C / IIC
– Breadboard
– 4x Kabel Jumper Male to Female
– Kabel Micro USD
– Aplikasi Thonny IDE

Wiring LCD I2C Ke Raspberry Pi Pico #

– connect the GND of the display to a GND (ground) pin (black cable)
– connect the VCC pin of the display with a 5V pin (red wire)
– connect the SDA pin of the display to GP0 (grey wire)
– connect the SDC pin of the display to GP1 (yellow wire)

Sample Code #

from machine import Pin, I2C
from lcd_api import LcdApi
from pico_i2c_lcd import I2cLcd

I2C_ADDR = 0x27
I2C_NUM_ROWS = 2
I2C_NUM_COLS = 16
i2c = I2C(0, sda=machine.Pin(0), scl=machine.Pin(1), freq=400000)
lcd = I2cLcd(i2c, I2C_ADDR, I2C_NUM_ROWS, I2C_NUM_COLS)

lcd.backlight_on()
lcd.putstr("Great! It Works!")
lcd.move_to(3,1)
lcd.putstr("khurslabs.com")

Hasil yang di tampilkan di Aplikasi Thonny IDE #

Mendeteksi Address I2C #

import machine
 
sda=machine.Pin(0)
scl=machine.Pin(1)
 
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
 
print('I2C address:')
print(i2c.scan(),' (decimal)')
print(hex(i2c.scan()[0]), ' (hex)')
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare
What are you looking for in Partdo?
× How can I help you?