Template: 1.3inch OLED HAT Jetson

From Waveshare Wiki
Jump to: navigation, search

Jetson Nano

Install Libraries

  • Open the trminal and enter the following commands
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install Jetson.GPIO
sudo groupadd -f -r gpio
sudo usermod -a -G gpio your_user_name
sudo cp /opt/nvidia/jetson-gpio/etc/99-gpio.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger

【Note】your_user_name is the username you use, such as waveshare

  • Install I2C
sudo apt-get install python-smbus
  • Install the image processing library:
sudo apt-get install python3-pil
sudo apt-get install python3-numpy

Download Program

sudo apt-get install p7zip
wget https://www.waveshare.com/w/upload/5/53/1.3inch-OLED-HAT-Code.7z
7z x 1.3inch-OLED-HAT-Code.7z
sudo chmod 777 -R  1.3inch-OLED-HAT-Code
cd 1.3inch-OLED-HAT-Code/JetsonNano/

Program Test

Due to the weak GPIO drive capability of Jetson Nano, it can only be controlled using SPI.

  • C
cd C
make clean
sudo ./main
  • python
cd python2
sudo python main.py
sudo python key_demo.py
cd python3
sudo python3 main.py
sudo python3 key_demo.py