Changes

Jump to navigation Jump to search

How to enable OLED display

259 bytes added, 18:47, 24 July 2023
no edit summary
'''2. Run the following command to check the oled i2c port'''
sudo i2cdetect -y 1
for X729, the I2C address is 0x3c, (In generally, the i2c address is 0x3c)
Please sure teh I2C is enable before this step, please refer to [[How to enable I2C]]
3.1 Download the required scripts
<pre>cd ~
# git clone https://github.com/suptronics/oled.git
git clone https://github.com/geekworm-com/oled cd oled</pre>
3.2 Install the Adafruit CircuitPython library
sudo python3 raspi-blinka.py
 
This process may take tens of minutes, please be patient
 
3.3 Answering Y and hitting Enter when reboot prompted. Then renavigate to the oled directly by entering:
3.4 Run the script to test the display
sudo python3 x510stats.py
OR
sudo python3 x729.py
Due to different hardware, you need to choose a different project file such as <code>x729.py </code> or x510<code>stats.py</code>
* x729<code>stats.py </code> is for most hardware such as [[X729NASPi CM4-M2]]* x510.py is for or [[NASPi CM4-M22.5]] or [[NASPi CM4-Gemini 2.5]]or [[X882]] shield.* <code>x729.py</code> is for [[X729]] shield.
3.5 Run the script at Raspberry Pi boot
PS: we must toogle to the /home/pi/oled directory because .ttf files is required to locate in current directory,you can refer to x729.py source file, or you can also remove the 'cd /home/pi/oled &&' if you use the absolute path of the ttf file in the source code.
@reboot cd /home/pi/oled && python3 /home/pi/oled/x729yourd-evice-name.py &
[[File:X729-9.png|none]]
Save and exit. In nanoeditor, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted.
==References==

Navigation menu