def rotate(self, value): """ Rotate the head clockwise or counter-clockwise. """ from robotics.arduino import Arduino neck_controller = Arduino("/dev/ttyUSB1") neck_controller.write(value)
def rotate(self, value): """ Rotate the head clockwise or counter-clockwise. """ from robotics.arduino import Arduino neck_controller = Arduino("/dev/ttyACM0") neck_controller.write(value)
def post(self): from flask import jsonify from robotics.arduino import Arduino json_data = request.get_json(force=True) speech_text = u'speech_text' if speech_text in json_data: data = json_data[speech_text] text_to_speech = Arduino("/dev/ttyUSB0") #print text_to_speech.list_device_ports() text_to_speech.write(data) return jsonify(json_data), 201 return jsonify({"warning": "required value not provided in request"}), 500