sucessful backend implementation for spectrometer

This commit is contained in:
d3m1g0d
2019-03-31 10:48:55 +02:00
parent c4fba54407
commit 36d77591f4
9 changed files with 31 additions and 19 deletions
+7 -14
View File
@@ -1,16 +1,9 @@
from flask import Flask, redirect, url_for, request
app = Flask(__Name__)
import sensors
import json
app = Flask(__name__)
s=sensors.Spectrometer(path='/dev/ttyACM0', baudrate=115200, tout=1)
@app.route('/list')
def list():
#Return list json
@app.route('/load'):
def load():
#Request args, load json
@app.route('/deposit'):
def deposit():
#Request .json, store json
if request.isJson():
request.json.
@app.route('/data')
def sendData():
return json.dumps(s.getData())