From 9634f8974893f9d31a492b6c62ca17b0032c6612 Mon Sep 17 00:00:00 2001 From: gsd Date: Tue, 11 Nov 2025 19:57:16 +0300 Subject: [PATCH] next --- install.sh | 1 + pipboyIO/config.sh | 1 + pipboyIO/pipboy-setup.sh | 24 +++++++++++++++++------- pipboyIO/pipboyIO.ino | 2 +- pipboyIO/serialTest.py | 4 ++-- 5 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..a9bf588 --- /dev/null +++ b/install.sh @@ -0,0 +1 @@ +#!/bin/bash diff --git a/pipboyIO/config.sh b/pipboyIO/config.sh index 49a619d..c1aa6da 100644 --- a/pipboyIO/config.sh +++ b/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" diff --git a/pipboyIO/pipboy-setup.sh b/pipboyIO/pipboy-setup.sh index 4c8276a..6b68568 100644 --- a/pipboyIO/pipboy-setup.sh +++ b/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/getty@tty1.service.d #nano /etc/systemd/system/getty@tty1.service.d/autologin.conf cat < /etc/systemd/system/getty@tty1.service.d/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 serial-getty@ttyS0.service -sudo systemctl disable serial-getty@ttyS0.service +#офаем через raspi-config +#sudo systemctl stop serial-getty@ttyS0.service +#sudo systemctl disable serial-getty@ttyS0.service 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 diff --git a/pipboyIO/pipboyIO.ino b/pipboyIO/pipboyIO.ino index fff49a3..26ec949 100644 --- a/pipboyIO/pipboyIO.ino +++ b/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(); diff --git a/pipboyIO/serialTest.py b/pipboyIO/serialTest.py index e2127b8..33feaed 100644 --- a/pipboyIO/serialTest.py +++ b/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)