Konstanten umbenannt
This commit is contained in:
parent
5e9e4dca21
commit
9eb08d9d96
14
photobox.py
14
photobox.py
@ -13,6 +13,8 @@ import pygame
|
|||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
# ~ import server
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -62,8 +64,8 @@ SHOT_COUNT = 3
|
|||||||
BORDER = 10
|
BORDER = 10
|
||||||
|
|
||||||
GPIO_LED_BORDER = 7
|
GPIO_LED_BORDER = 7
|
||||||
GPIO_RIGHT_SPOT = 35
|
GPIO_SPOT_RIGHT = 35
|
||||||
GPIO_LEFT_SPOT = 37
|
GPIO_SPOT_LEFT = 37
|
||||||
GPIO_BUTTON_LED = 36
|
GPIO_BUTTON_LED = 36
|
||||||
GPIO_BUTTON = 38
|
GPIO_BUTTON = 38
|
||||||
|
|
||||||
@ -91,8 +93,8 @@ def led_border(state):
|
|||||||
def set_spot_mode(new_mode):
|
def set_spot_mode(new_mode):
|
||||||
global spot_mode
|
global spot_mode
|
||||||
spot_mode = new_mode % 4
|
spot_mode = new_mode % 4
|
||||||
GPIO.output(GPIO_LEFT_SPOT, not (spot_mode & 1))
|
GPIO.output(GPIO_SPOT_LEFT, not (spot_mode & 1))
|
||||||
GPIO.output(GPIO_RIGHT_SPOT, not (spot_mode & 2))
|
GPIO.output(GPIO_SPOT_RIGHT, not (spot_mode & 2))
|
||||||
|
|
||||||
|
|
||||||
def next_spot_mode():
|
def next_spot_mode():
|
||||||
@ -112,8 +114,8 @@ def button_press(gpio_id):
|
|||||||
GPIO.setmode(GPIO.BOARD)
|
GPIO.setmode(GPIO.BOARD)
|
||||||
GPIO.setwarnings(False)
|
GPIO.setwarnings(False)
|
||||||
|
|
||||||
GPIO.setup(GPIO_RIGHT_SPOT, GPIO.OUT, initial=GPIO.HIGH)
|
GPIO.setup(GPIO_SPOT_RIGHT, GPIO.OUT, initial=GPIO.HIGH)
|
||||||
GPIO.setup(GPIO_LEFT_SPOT, GPIO.OUT, initial=GPIO.HIGH)
|
GPIO.setup(GPIO_SPOT_LEFT, GPIO.OUT, initial=GPIO.HIGH)
|
||||||
GPIO.setup(GPIO_LED_BORDER, GPIO.OUT, initial=GPIO.LOW)
|
GPIO.setup(GPIO_LED_BORDER, GPIO.OUT, initial=GPIO.LOW)
|
||||||
GPIO.setup(GPIO_BUTTON_LED, GPIO.OUT, initial=GPIO.LOW)
|
GPIO.setup(GPIO_BUTTON_LED, GPIO.OUT, initial=GPIO.LOW)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user