Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
selfisch committed Oct 29, 2017
1 parent 1e5b43b commit 306f637
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ def gpio_setup():
GPIO.setup(AuxPin, GPIO.OUT) # Set LedPin's mode is output
GPIO.output(AuxPin, GPIO.LOW) # Set LedPin to low(0V)

p = GPIO.PWM(TunerPin, 1000) # set Frequece to 1KHz
p.start(0) # Duty Cycle = 0

def loop(source):
if source == 'Tuner':
p = GPIO.PWM(TunerPin, 1000) # set Frequece to 1KHz
p.start(0) # Duty Cycle = 0
elif source == 'Aux':
p = GPIO.PWM(AuxPin, 1000) # set Frequece to 1KHz
p.start(0) # Duty Cycle = 0

def loop():
while True:
for dc in range(0, 101, 4): # Increase duty cycle: 0~100
p.ChangeDutyCycle(dc) # Change duty cycle
Expand All @@ -83,7 +87,7 @@ def destroy():
try:
logger.info('Starte die Anwendung')
gpio_setup()
loop()
loop('Tuner')

if check_usbbtn != 'n':
button_press_thread.start()
Expand Down

0 comments on commit 306f637

Please sign in to comment.