mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-04 22:25:39 +00:00
GPIO work
This commit is contained in:
@@ -3,14 +3,12 @@ import logging
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class GPIOManager():
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
GPIO.setmode(GPIO.BCM)
|
|
||||||
GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
|
|
||||||
GPIO.add_event_detect(23, GPIO.RISING, callback=printFunction, bouncetime=300)
|
|
||||||
|
|
||||||
|
|
||||||
def printFunction():
|
def printFunction():
|
||||||
logger.error("Sakatu da")
|
logger.error("Sakatu da")
|
||||||
|
|
||||||
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
|
||||||
|
GPIO.add_event_detect(23, GPIO.RISING, callback=printFunction, bouncetime=300)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener):
|
|||||||
# Raspberry pi GPIO
|
# Raspberry pi GPIO
|
||||||
self.gpio = config['touchscreen']['gpio']
|
self.gpio = config['touchscreen']['gpio']
|
||||||
if self.gpio:
|
if self.gpio:
|
||||||
from .gpio_inpput_manager import GPIOManager
|
import GPIOManager
|
||||||
self.gpio = GPIOManager()
|
|
||||||
|
|
||||||
def start_thread(self):
|
def start_thread(self):
|
||||||
clock = pygame.time.Clock()
|
clock = pygame.time.Clock()
|
||||||
|
|||||||
Reference in New Issue
Block a user