gsd 7 months ago
parent
commit
9634f89748
  1. 1
      install.sh
  2. 1
      pipboyIO/config.sh
  3. 24
      pipboyIO/pipboy-setup.sh
  4. 2
      pipboyIO/pipboyIO.ino
  5. 4
      pipboyIO/serialTest.py

1
install.sh

@ -0,0 +1 @@
#!/bin/bash

1
pipboyIO/config.sh

@ -1,3 +1,4 @@
#!/bin/bash
# Check if running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Use sudo ./setup_tft.sh"

24
pipboyIO/pipboy-setup.sh

@ -10,8 +10,17 @@ echo "Updating the system and installing dependencies..."
apt update && apt upgrade -y
apt install -y cmake git build-essential nano
#raspi userland
git clone https://github.com/raspberrypi/userland.git
cd userland
./buildme
cd ~
#fix so libs
echo "/opt/vc/lib" >> /etc/ld.so.conf.d/vc.conf
sudo ldconfig
#build deps and remove raspi features
sudo apt install -y libraspberrypi-dev
git clone https://github.com/juj/fbcp-ili9341.git
cd fbcp-ili9341
mkdir build && cd build
@ -22,14 +31,14 @@ make -j$(nproc)
sudo install fbcp-ili9341 /usr/local/bin/
./config.sh
#make autologin
#make autologin #after this is not fine
sudo su
mkdir -pv /etc/systemd/system/[email protected]
#nano /etc/systemd/system/[email protected]/autologin.conf
cat <<EOT > /etc/systemd/system/[email protected]/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin gsd --noclear %I $TERM
ExecStart=-/sbin/agetty --autologin pipboy --noclear %I $TERM
EOT
#Xserver and chromium
@ -68,13 +77,14 @@ enable_uart=1
dtoverlay=uart0
EOT
sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
#офаем через raspi-config
#sudo systemctl stop [email protected]
#sudo systemctl disable [email protected]
sudo apt install python3-serial
#sound https://withrow.io/simpsons-tv-build-guide-waveshare#parts-list
dtparam=audio=on
dtoverlay=audremap,enable_jack,pins_18_13
#dtparam=audio=on
#dtoverlay=audremap,enable_jack,pins_18_13
#dtparam=audio=off
# dtparam=audio=on # закомментируйте или удалите эту строку
#dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4

2
pipboyIO/pipboyIO.ino

@ -24,7 +24,7 @@ void values2uart() {
void loop() {
for (int i = 0; i < numPins; i++) {
inputValue[i] = map(analogRead(input[i]), 0, 4096, 0, 100);
inputValue[i] = map(analogRead(input[i]), 0, 4096, 0, 50);
}
values2uart();

4
pipboyIO/serialTest.py

@ -22,8 +22,8 @@ class Pin:
def updateValue(self, value):
if self.value == value:
return (self, 0)
elif abs(self.value - value) in [1,2,3,4]:
return (self, 0)
#elif abs(self.value - value) in [1,2,3,4]:
# return (self, 0)
else:
self.value = value
return (self, value)

Loading…
Cancel
Save