Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, render_template, request
- from sense_hat import SenseHat
- app = Flask(__name__)
- sense = SenseHat()
- @app.route('/')
- def index():
- return render_template('index.html')
- @app.route('/send', methods=['POST'])
- def send():
- text = request.form['text']
- sense.show_message(text)
- return "Text sent to Sense HAT!"
- if __name__ == "__main__":
- app.run(host='0.0.0.0')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement