Created
September 16, 2013 20:56
-
-
Save pmarkun/6586493 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from unidecode import unidecode | |
| import serial | |
| ser = serial.Serial('/dev/ttyACM0', 9600) | |
| @app.route("/<mensagem>") | |
| def hello(mensagem="Hello World!"): | |
| mensagem = unidecode(mensagem.upper()) | |
| ser.write(mensagem) | |
| return mensagem | |
| if __name__ == "__main__": | |
| app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
muda o app.run para app.run(host='0.0.0.0'), assim da pra acessar fora do localhost :)