changed a lot

This commit is contained in:
Michael Clemens 2019-09-11 20:01:06 +01:00
parent 03b34d6fa8
commit b89488f602
2 changed files with 12 additions and 5 deletions

View File

@ -13,8 +13,8 @@ RELAIS_2_GPIO = 1
GPIO.setup(RELAIS_1_GPIO, GPIO.OUT)
GPIO.setup(RELAIS_2_GPIO, GPIO.OUT)
GPIO.output(RELAIS_1_GPIO, GPIO.HIGH)
GPIO.output(RELAIS_2_GPIO, GPIO.HIGH)
#GPIO.output(RELAIS_1_GPIO, GPIO.HIGH)
#GPIO.output(RELAIS_2_GPIO, GPIO.HIGH)
@app.route('/')
def start():
@ -35,10 +35,11 @@ def index():
GPIO.output(RELAIS_2_GPIO, GPIO.LOW)
print('Antenna 2 selected')
return redirect(url_for('start'))
if request.form['ant_button'] == 'Antenna Off':
if request.form['ant_button'] == 'Antenna 3':
GPIO.output(RELAIS_1_GPIO, GPIO.HIGH)
time.sleep(1)
GPIO.output(RELAIS_2_GPIO, GPIO.HIGH)
print('Off: No antenna attached')
print('Antenna 2 selected')
return redirect(url_for('start'))
else:
print(request.form.action)

View File

@ -1,14 +1,20 @@
<html>
<head>
<title>AntennaPi</title>
</head>
<body>
<form action = "/index" method = "post">
<div>
<input type ="submit" name="ant_button" value="Antenna 1">
X200
</div>
<div>
<input type ="submit" name="ant_button" value="Antenna 2">
20m Dipol
</div>
<div>
<input type ="submit" name="ant_button" value="Antenna Off">
<input type ="submit" name="ant_button" value="Antenna 3">
40-20-10 Windom
</div>
</form>
</body>