Difference between revisions of "How to enable OLED display"
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
2. Run the following command to check the oled i2c port | 2. Run the following command to check the oled i2c port | ||
sudo i2cdetect -y 1 | sudo i2cdetect -y 1 | ||
+ | for X729, the I2C address is 0x3c | ||
− | + | pi@raspberrypi ~ $ cd oled | |
+ | |||
+ | (7.2) Install the Adafruit CircuitPython library | ||
+ | pi@raspberrypi:~/oled $ sudo python3 raspi-blinka.py | ||
+ | |||
+ | (7.3) Answering Y and hitting Enter when reboot prompted. Then renavigate to the oled directly by entering: | ||
+ | pi@raspberrypi ~ $ cd oled | ||
+ | |||
+ | (7.4) Run the script to test the display | ||
+ | pi@raspberrypi:~/oled $ sudo python3 x729.py | ||
+ | |||
+ | (7.5) Run the script at Raspberry Pi boot | ||
+ | pi@raspberrypi:~/oled $ sudo crontab -e | ||
+ | |||
+ | (7.6) Add a line at the end of the file that reads like this: | ||
+ | @reboot cd /home/pi/oled && python3 /home/pi/oled/x729.py & | ||
+ | [[File:X729-9.png|none]] | ||
+ | |||
+ | Save and exit. In nano, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted. | ||
<!--Add review function! --> | <!--Add review function! --> |
Revision as of 17:55, 19 November 2022
How to enable OLED display on Raspbian:
1. Update your Pi and Install the required dependencies
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install i2c-tools python3-smbus python-smbus
sudo apt-get -y install python3-pip python3-pil
sudo pip3 install --upgrade setuptools
sudo pip3 install --upgrade adafruit-python-shell
sudo pip3 install adafruit-circuitpython-ssd1306
sudo pip3 install pi-ina219
sudo pip3 show pi-ina219
2. Run the following command to check the oled i2c port
sudo i2cdetect -y 1
for X729, the I2C address is 0x3c
pi@raspberrypi ~ $ cd oled
(7.2) Install the Adafruit CircuitPython library
pi@raspberrypi:~/oled $ sudo python3 raspi-blinka.py
(7.3) Answering Y and hitting Enter when reboot prompted. Then renavigate to the oled directly by entering:
pi@raspberrypi ~ $ cd oled
(7.4) Run the script to test the display
pi@raspberrypi:~/oled $ sudo python3 x729.py
(7.5) Run the script at Raspberry Pi boot
pi@raspberrypi:~/oled $ sudo crontab -e
(7.6) Add a line at the end of the file that reads like this:
@reboot cd /home/pi/oled && python3 /home/pi/oled/x729.py &
Save and exit. In nano, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted.
Enable comment auto-refresher
Anonymous user #2
Permalink |
Lisa
Anonymous user #1
Permalink |
Harry