Skip to content

panyingyun/Pioneer600

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pioneer600

Learn hardware by golang on Raspberry Pi 4 More from my own Blog

1、Hardware

2、Rom & OS

  • Raspberry Pi OS (32-bit) Lite (Raspbian GNU/Linux 10)

3、Boot config file

open i2c、spi、1-wire interface

config.txt

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=w1-gpio,gpio_pin=4

4、How to build

//ssh to your board and prepare Pioneer600
//and install git tools 
sudo apt-get update
sudo apt-get upgrade
sudo apt install -y vim git build-essential 
sudo apt install -y golang

//clone code 
git clone git@github.com:panyingyun/Pioneer600.git

//build 
cd Pioneer600/cmd

//build arm
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build  -o Pioneer600

5、How to run

  • Test Gpio LED (D1)
sudo ./Pioneer600 -f 0
  • I2C Test PCF8574 LED(D2)
sudo ./Pioneer600 -f 1
  • I2C Test PCF8574 Beep
sudo ./Pioneer600 -f 2
  • 1-Wire Test DS18b20.
sudo ./Pioneer600 -f 3
  • I2C RTC Test DS3231.
sudo ./Pioneer600 -f 4
  • SPI Test SSD1306.
sudo ./Pioneer600 -f 5

6、Auto run when reboot OS

Run build_arm64.sh, it will autorun Pioneer600 when reboot os

chmod 755 build_arm64.sh 
sudo sh build_arm64.sh 

Other shell cmd

// enable 
sudo systemctl enable Pioneer600.service

// disable 
sudo systemctl disable Pioneer600.service

// start service 
sudo systemctl start  Pioneer600.service

// stop 
sudo systemctl stop Pioneer600.service

// restart 
sudo systemctl restart Pioneer600.service

7、Thanks To

 	logger.Info("Raspberry Pi 4 and Pioneer600")
	logger.Info("Learn how to use golang control devices.")
	logger.Info("Thanks to https://gobot.io")
	logger.Info("Thanks to http://www.waveshare.net.")
	logger.Info("Thanks to https://periph.io/project/goals.")

Releases

No releases published

Packages

No packages published