|
|
@ -37,16 +37,6 @@ def applyDeadZone(value, threshold): |
|
|
|
new_value = new_value * -1 |
|
|
|
return new_value |
|
|
|
|
|
|
|
@socketio.on('text') |
|
|
|
def display_text(text): |
|
|
|
print("display_text()") |
|
|
|
print(text['data']) |
|
|
|
if isinstance(text['data'], str): |
|
|
|
if len(text['data']) < 250: |
|
|
|
from roberto import serial |
|
|
|
command = 'T '+str(text['data']) |
|
|
|
serial.write(bytes(command, "utf8")) |
|
|
|
|
|
|
|
# https://pfertyk.me/2020/03/webrtc-a-working-example/ |
|
|
|
|
|
|
|
from roberto import webrtccamera |
|
|
@ -87,6 +77,17 @@ def battery_message(data): |
|
|
|
sid = request.sid |
|
|
|
socketio.emit('battery', data, room=ROOM, skip_sid=sid) |
|
|
|
|
|
|
|
@socketio.on('text') |
|
|
|
def display_text(text): |
|
|
|
print("display_text()") |
|
|
|
print(text['data']) |
|
|
|
if isinstance(text['data'], str): |
|
|
|
if len(text['data']) < 250: |
|
|
|
from roberto import serial |
|
|
|
command = 'T '+str(text['data']) |
|
|
|
serial.write(bytes(command, "utf8")) |
|
|
|
socketio.emit('text', text, room=ROOM) |
|
|
|
|
|
|
|
@socketio.on('disconnect') |
|
|
|
def disconnect(): |
|
|
|
sid = request.sid |
|
|
|