mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
wrote own functions for sending data
This commit is contained in:
@@ -91,14 +91,13 @@ def database():
|
||||
cursor.close()
|
||||
return str(rows)
|
||||
|
||||
def sensor_data():
|
||||
def sensor_data(kobuki_message):
|
||||
db = get_db()
|
||||
cursor = db.cursor()
|
||||
cursor.execute("SELECT * FROM kobuki_data")
|
||||
rows = cursor.fetchall()
|
||||
sql_sensor = "INSERT INTO kobuki_data (data) VALUES (%s)"
|
||||
cursor.execute(sql_sensor, (kobuki_message,))
|
||||
db.commit()
|
||||
cursor.close()
|
||||
return str(rows)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, port=5000)
|
||||
|
Reference in New Issue
Block a user