Coder Social home page Coder Social logo

absminitowerkit's Introduction

absminitowerkit

ABS mini tower kit 's driver and installation script.

How to install ( Installation script works on Raspberry Pi OS 64bit )

    1. Download the latest image from https://www.raspberrypi.com/software/
    1. Flash it to your TF Card with etcher tool, Download link: https://etcher.io/
    1. After flashing, insert the TF card back to Raspberry Pi card Slot.
    1. Power up your Raspberry Pi and make sure it can access internet.
    1. Update Repository and Upgrade packages.
sudo apt update 
sudo apt upgrade -y 
    1. Enable I2C on Raspberry Pi.
sudo raspi-config

Navigate to Interface Options -> I2C -> Enable -> Select YES.

    1. Clone Repository.
git clone https://github.com/geeekpi/absminitowerkit.git
    1. Install driver.
cd absminitowerkit/
sudo ./install.sh
    1. Reboot and have fun.
sudo sync
sudo reboot

##Install script for Ubuntu 22.04 LTS User

  1. 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
  1. Grant permission to current user
sudo usermod -a -G roo,i2c `whoami`
id `whoami`
  1. 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.

  1. Download luma.examples OLED demo code repository and install the dependencies packages.
cd 
git clone https://github.com/rm-hull/luma.exmaples 
cd luma.examples/
sudo pip3 -H install -e .
  1. 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 &
  1. 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
  1. 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):
         np[1] = (randint(0,i), randint(i, 255), randint(i, 255))
         np[2] = (randint(0,i), randint(i, 255), randint(0, i))
         np[3] = (randint(i, 255), randint(0, i), randint(i, 255))
         time.sleep(0.02)
         np[4] = (0, 0, 0)  # turns off all leds

execute the python file like :

sudo python3 moodlight.py 

How to turn off all leds?

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

That's all

Have a nice day and have fun!

absminitowerkit's People

Contributors

yoyojacky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.