ABS mini tower kit 's driver and installation script.
-
- Download the latest image from https://www.raspberrypi.com/software/
-
- Flash it to your TF Card with etcher tool, Download link: https://etcher.io/
-
- After flashing, insert the TF card back to Raspberry Pi card Slot.
-
- Power up your Raspberry Pi and make sure it can access internet.
-
- Update Repository and Upgrade packages.
sudo apt update
sudo apt upgrade -y
-
- Enable I2C on Raspberry Pi.
sudo raspi-config
Navigate to Interface Options
-> I2C
-> Enable -> Select YES
.
-
- Clone Repository.
git clone https://github.com/geeekpi/absminitowerkit.git
-
- Install driver.
cd absminitowerkit/
sudo chmod +x install.sh
sudo ./install.sh
-
- Reboot and have fun.
sudo sync
sudo reboot
##Install script for Ubuntu 22.04 LTS User
- please follow the steps to install libraries and packages:
sudo apt update
sudo apt -y upgrade
sudo apt -y install tree vim git i2c-tools python3 python3-pil python3-pip libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev libopenjp2-7 libtiff5
- Grant permission to current user
sudo usermod -a -G roo,i2c `whoami`
id `whoami`
- Detect OLED display's address. Default address will be : 0x3c
sudo i2cdetect -y 1
If you can not see the correct address, please check the connection of oled display driver board and raspberry Pi GPIO.
- Download luma.examples OLED demo code repository and install the dependencies packages.
cd
git clone https://github.com/rm-hull/luma.examples.git
cd luma.examples/
sudo pip3 -H install -e .
- Test demo code
sudo python3 clock.py
If you can see clock on OLED display, you can press ctrl+C to quit program. 6. Download geeekpi abs minitower kit repository:
git clone https://github.com/geeekpi/absminitowerkit
cd absminitowerkit/
cp sysinfo.py ../luma.examples/examples/
cd ../luma.examples/examples/
sudo pip3 install psutil
sudo python3 sysinfo.py
I will show the system information on OLED screen, if you want to put it into background and running. try this command:
sudo python3 sysinfo.py &
- How to turn on the mood light? Actually, Mood light system is 2 RGB ws281x led strip. One of them is soldered in back of the OLED driver board, it is number 1, another one is in the fan which is number 2. Just install following libraries to driver the leds.
sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
- Write a demo code to light up each led, create a new python file named moodlight.py and input following code and execute it.
import board
import neopixel
import time
from random import randint
pixels = neopixel.NeoPixel(board.D18, 4) # D18 means connect to GPIO18 on Raspberry Pi. 4 means 4 leds
# led on back of OLED driver board, (255, 0 , 0 ) is RGB format of the light, value from 0-255, (255,0,0) means (red, green, blue) it will turn on the light to red color. (0, 0, 0 ) will turn off the color.
pixels[0] = (255, 0, 0)
# led on fan
pixels[1] = (0, 255, 0) # NO.1 LED turns on fan color to green
pixels[2] = (255, 0, 0) # NO.2 LED turns on fan color to red
pixels[3] = (0, 0, 255) # NO.3 LED turns on fan color to blue
# turns off leds on fan
pixels[4] = (0, 0, 0) # turns off all leds on fan
# turn off RGB LED on board
pixels[0].fill((0,0,0))
# while loop
while True:
for i in range(0, 255):
pixels[1] = (randint(0,i), randint(i, 255), randint(i, 255))
pixels[2] = (randint(0,i), randint(i, 255), randint(0, i))
pixels[3] = (randint(i, 255), randint(0, i), randint(i, 255))
time.sleep(0.02)
pixels[4] = (0, 0, 0) # turns off all leds
execute the python file like :
sudo python3 moodlight.py
just copy following code to a file and execute it.
import board
from neopixel import NeoPixel
np = NeoPixel(board.D18, 4)
np.fill((0,0,0))
Save it and execute it:
sudo python3 turnoff_leds.py
Have a nice day and have fun!