Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    def get(self):
        """
        Display a list of device ports for easy debugging.
        """
        from robotics.arduino import Arduino
        from flask import jsonify

        arduino = Arduino()

        data = arduino.list_device_ports()
        return jsonify({"results": data})
Ejemplo n.º 4
0
    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
Ejemplo n.º 5
0
    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