Skip to content
Snippets Groups Projects
Commit 1205b2fe authored by Mehmet Salih Hasanoglu's avatar Mehmet Salih Hasanoglu
Browse files
parents 435f680b e45f9d03
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import os import os
import json import json
import time import time
import RPi.GPIO as GPIO
from flask import Flask, request, jsonify, abort from flask import Flask, request, jsonify, abort
from flask_cors import CORS from flask_cors import CORS
...@@ -47,11 +49,19 @@ def create_app(test_config=None): ...@@ -47,11 +49,19 @@ def create_app(test_config=None):
if lamp_id == 1: if lamp_id == 1:
# Leuchte 1 für Reaktion "Frage" (BLAU) # Leuchte 1 für Reaktion "Frage" (BLAU)
# activate GPIO pins
# set GPIO pins, requesting pins bei the board numbers (1-40)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)
GPIO.output(11,GPIO.LOW)
# activate GPIO pins
GPIO.output(11,GPIO.HIGH)
time.sleep(5) time.sleep(5)
# dectivate GPIO pins # deactivate GPIO pins
GPIO.output(11,GPIO.LOW)
GPIO.cleanup()
if lamp_id == 2: if lamp_id == 2:
# Leuchte 2 für Reaktion "Daumen hoch" (GRÜN) # Leuchte 2 für Reaktion "Daumen hoch" (GRÜN)
...@@ -135,3 +145,4 @@ app = create_app() ...@@ -135,3 +145,4 @@ app = create_app()
if __name__ == '__main__': if __name__ == '__main__':
app.run(host = "0.0.0.0") app.run(host = "0.0.0.0")
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment