tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit 82598d59f64e31a4aa84b5cabf810608ead6ef4d
parent a684fce7959d9127ccc92d32fffddb9506e8a6ec
Author: rbckman <rob@tarina.org>
Date:   Wed, 25 Jan 2023 12:59:36 +0000

no i2cbuttons but a yes to a screen

Diffstat:
Mtarina.py | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tarina.py b/tarina.py @@ -75,7 +75,7 @@ while probei2c < 10: #MAIN def main(): - global headphoneslevel, miclevel, tarinafolder, screen, loadfilmsettings, plughw, channels, filmfolder, filmname, scene, showmenu, quality, profilelevel + global headphoneslevel, miclevel, tarinafolder, screen, loadfilmsettings, plughw, channels, filmfolder, filmname, scene, showmenu, quality, profilelevel, i2cbuttons # Get path of the current dir, then use it as working directory: rundir = os.path.dirname(__file__) if rundir != '': @@ -3332,6 +3332,7 @@ def flushbutton(): break def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): + global i2cbuttons with term.cbreak(): val = term.inkey(timeout=0) if val.is_sequence: @@ -3346,6 +3347,10 @@ def getbutton(lastbutton, buttonpressed, buttontime, holdbutton): if i2cbuttons == True: readbus = bus.read_byte_data(DEVICE,GPIOB) readbus2 = bus.read_byte_data(DEVICE,GPIOA) + if readbus == 0: + readbus = 255 + if readbus2 == 0: + readbus2 = 247 if readbus != 255: print('i2cbutton pressed: ' + str(readbus)) if readbus2 != 247: