commit c7926dc3b9220565113c61c3d1a593f146880817
parent d73c9c659128c5143d44abc6ef362f7f55d390d5
Author: rbckman <rob@tarina.org>
Date: Wed, 13 Apr 2022 21:13:51 +0100
turn off screen
Diffstat:
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/install.sh b/install.sh
@@ -57,9 +57,9 @@ apt-get update
apt-get upgrade -y
if [ "$version" = "buster" ]
then
- apt-get -y install git python3-pip python-configparser ffmpeg mediainfo gpac omxplayer sox cpufrequtils apache2 libapache2-mod-wsgi-py3 libdbus-glib-1-dev dbus libdbus-1-dev usbmount python3-numpy python3-pil python3-smbus python3-shortuuid
+ apt-get -y install git python3-pip python-configparser ffmpeg mediainfo gpac omxplayer sox cpufrequtils apache2 libapache2-mod-wsgi-py3 libdbus-glib-1-dev dbus libdbus-1-dev usbmount python3-numpy python3-pil python3-smbus python3-shortuuid wiringpi
else
- apt-get -y install git python3-pip python-configparser libav-tools mediainfo gpac omxplayer sox cpufrequtils apache2 libapache2-mod-wsgi-py3 libdbus-glib-1-dev dbus libdbus-1-dev usbmount python3-numpy python3-pil python3-smbus python3-shortuuid
+ apt-get -y install git python3-pip python-configparser libav-tools mediainfo gpac omxplayer sox cpufrequtils apache2 libapache2-mod-wsgi-py3 libdbus-glib-1-dev dbus libdbus-1-dev usbmount python3-numpy python3-pil python3-smbus python3-shortuuid wiringpi
fi
echo "installing python-omxplayer-wrapper..."
sudo pip3 install omxplayer-wrapper
diff --git a/tarina.py b/tarina.py
@@ -95,7 +95,7 @@ def main():
awbx = 0
awb_lock = 'no'
fps = 24.999
- quality = 25
+ quality = 27
headphoneslevel = 40
miclevel = 50
recording = False
@@ -114,6 +114,7 @@ def main():
beeps = 0
beepcountdown = 0
beeping = False
+ backlight = True
lastbeep = time.time()
flip = 'no'
between = 30
@@ -501,7 +502,7 @@ def main():
loadfilmsetings = True
except:
writemessage('hmm.. couldnt enter developer mode')
- #DEVELOP
+ #PICTURE
elif event == 'J':
try:
stopinterface(camera)
@@ -513,6 +514,14 @@ def main():
loadfilmsetings = True
except:
writemessage('hmm.. couldnt enter developer mode')
+ elif pressed == 'screen':
+ if backlight == False:
+ # requires wiringpi installed
+ run_command('gpio -g pwm 19 1023')
+ backlight = True
+ elif backlight == True:
+ run_command('gpio -g pwm 19 0')
+ backlight = False
#REMOVE
#take
elif pressed == 'remove' and menu[selected] == 'TAKE:':
@@ -3178,9 +3187,11 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton):
pressed = 'view'
elif event == 'KEY_DELETE' or readbus2 == 246:
pressed = 'remove'
- elif event == 'P' or (readbus2 == 245 and readbus == 191):
+ elif (readbus2 == 245 and readbus == 191):
pressed = 'peak'
- elif event == 'I' or (readbus2 == 244 and readbus == 255):
+ elif (readbus2 == 245 and readbus == 223):
+ pressed = 'screen'
+ elif event == 'I' or event == 'P' or (readbus2 == 244 and readbus == 255):
pressed = 'insert'
elif event == 'C' or (readbus2 == 245 and readbus == 254):
pressed = 'copy'
@@ -3188,6 +3199,8 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton):
pressed = 'move'
#elif readbus2 == 247:
# pressed = 'shutdown'
+ if pressed != '':
+ print(pressed)
buttontime = time.time()
holdbutton = pressed
buttonpressed = True