diff --git a/gerbers/PiFinder-top-plate.zip b/gerbers/PiFinder-top-plate.zip index 00b68b76..7645727f 100644 Binary files a/gerbers/PiFinder-top-plate.zip and b/gerbers/PiFinder-top-plate.zip differ diff --git a/gerbers/PiFinder.zip b/gerbers/PiFinder.zip index e720f9b2..bb5df6cf 100644 Binary files a/gerbers/PiFinder.zip and b/gerbers/PiFinder.zip differ diff --git a/images/ui_reference.png b/images/ui_reference.png index ab0dde62..bbdf7766 100644 Binary files a/images/ui_reference.png and b/images/ui_reference.png differ diff --git a/pifinder_post_update.sh b/pifinder_post_update.sh index 51992b2e..80b122d5 100644 --- a/pifinder_post_update.sh +++ b/pifinder_post_update.sh @@ -1,4 +1,5 @@ sudo apt install -y gpsd sudo dpkg-reconfigure -plow gpsd +sudo sed -zi '/dtoverlay=pwm,pin=13,func=4\n/!s/$/\ndtoverlay=pwm,pin=13,func=4\n/' /boot/config.txt echo "Post Update Complete" diff --git a/pifinder_setup.sh b/pifinder_setup.sh index b76f1384..2d8d8b66 100644 --- a/pifinder_setup.sh +++ b/pifinder_setup.sh @@ -36,6 +36,7 @@ git clone https://github.com/esa/tetra3.git echo "dtparam=spi=on" | sudo tee -a /boot/config.txt echo "dtparam=i2c_arm=on" | sudo tee -a /boot/config.txt echo "dtparam=i2c_arm_baudrate=10000" | sudo tee -a /boot/config.txt +echo "dtoverlay=pwm,pin=13,func=4" | sudo tee -a /boot/config.txt # Enable service sudo cp /home/pifinder/PiFinder/pifinder.service /etc/systemd/system/pifinder.service diff --git a/python/PiFinder/main.py b/python/PiFinder/main.py index 85f956aa..820f9d58 100644 --- a/python/PiFinder/main.py +++ b/python/PiFinder/main.py @@ -22,7 +22,7 @@ from multiprocessing.managers import BaseManager from timezonefinder import TimezoneFinder -import RPi.GPIO as GPIO +from rpi_hardware_pwm import HardwarePWM from luma.core.interface.serial import spi from luma.core.render import canvas @@ -55,9 +55,7 @@ KEYPAD_LEDPIN = 13 -GPIO.setmode(GPIO.BCM) -GPIO.setup(KEYPAD_LEDPIN, GPIO.OUT) -keypad_pwm = GPIO.PWM(KEYPAD_LEDPIN, 100) # create PWM instance with frequency +keypad_pwm = HardwarePWM(pwm_channel=1, hz=120) keypad_pwm.start(0) @@ -80,7 +78,7 @@ def set_brightness(level, cfg): "Off": 0, } keypad_brightness = cfg.get_option("keypad_brightness") - keypad_pwm.ChangeDutyCycle(level * 0.1 * keypad_offsets[keypad_brightness]) + keypad_pwm.change_duty_cycle(level * 0.05 * keypad_offsets[keypad_brightness]) class StateManager(BaseManager): diff --git a/requirements.txt b/requirements.txt index 1d494607..342ddcd7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,14 @@ +adafruit-blinka==8.12.0 +adafruit-circuitpython-bno055 +luma.oled==3.9.0 numpy==1.23.4 +pandas==1.5.3 pytz==2022.7.1 -timezonefinder==6.1.9 -luma.oled==3.9.0 -skyfield==1.45 +requests==2.28.2 +rpi-hardware-pwm==0.1.4 scipy==1.10.0 scikit-learn==1.2.2 -requests==2.28.2 -adafruit-blinka==8.12.0 -adafruit-circuitpython-bno055 -pandas==1.5.3 sh==1.14.3 +skyfield==1.45 +timezonefinder==6.1.9 tqdm==4.65.0