Step-by-step instructions for setting up a Raspberry Pi Zero W with an Adafruit 1.3" OLED bonnet
For this, you'll minimally need:
- Raspberry Pi Zero WH (a Zero W with header) $14
- Adafruit 1.3" OLED bonnet $22.50
- A 4GB or bigger microSD adapter ~$7
- A standard Raspberry 2.6A 5V power supply with micro USB plug
Install the OLED hat on top of the headers provided with the Raspberry Pi Zero WH. Remove the film on the top by pulling up on the provided blue tab.
- Download Raspbian Stretch Lite and using something like Etcher, burn that image to the microSD adapter while in your workstation
- Once finished, Etcher will automatically eject the media. Remove and replace the microSD to re-mount it.
- In a Terminal, run the following commands (assuming OSX):
sudo touch /Volumes/boot/ssh
sudo touch /Volumes/boot/wpa_supplicant.conf
sudo nano /Volumes/boot/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="insert_your_hidden_SSID_here"
psk="insert_your_wifi_password_here"
key_mgmt=WPA-PSK
}
Save the file, safely eject the media and put it into the Raspberry Pi.
ssh pi@raspberrypi.local
and useraspberry
as the default passwordsudo apt-get update
sudo apt-get upgrade -y
sudo raspi-config
- 7 Advanced Options -> A1 Expand Filesystem
- 2 Network Options -> N1 Hostname (I'm changing mine to
glacier
) - 3 Boot Options -> B1 Desktop/CLI -> B2 Console Autologin
- 4 Localisation Options -> I1 Change Locale, I2 Change Timezone, I3 Change Keyboard Layout and I4 Change Wi-Fi Country
- 5 Interfacing Options -> P5 I2C
- 8 Update
- Finish and reboot (use
sudo reboot
if it doesn't do it for you)
ssh pi@glacier.local
(or whatever you named yours)sudo apt-get install build-essential python-dev python-pip -y
sudo pip install RPi.GPIO
# Possibly already installedsudo apt-get install python-imaging python-smbus i2c-tools -y
sudo apt-get install git -y
mkdir ~/sites && cd ~/sites
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
cd Adafruit_Python_SSD1306
sudo python setup.py install
sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
This means that the OLED was found at address 0x3c
.
15. sudo python examples/buttons.py
Press each button and exercise the joystick to see all the interactions. Press Ctl-C to exit from this Python script.
Also try sudo python examples/animate.py
, sudo python examples/image.py
, 'sudo python examples/shapes.py' and sudo python examples/stats.py
. You may want to edit each of these by commenting out this line:
disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST)
...and uncommenting this one:
disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST)
...which is the appropriate driver for this display (64 pixels tall).
16. sudo nano /boot/config.txt
Add this to the bottom of the file:
# Speed up the display to 1Mhz
dtparam=i2c_baudrate=1000000
17. sudo reboot
Description | Version | Author | Last Update |
---|---|---|---|
pizero-oled | v1.0.1 | OutsourcedGuru | July 7, 2018 |
Donate | Cryptocurrency | |
---|---|---|
Ethereum | Bitcoin |