Advertisement
silver2row

for_Flask

Dec 8th, 2022
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from flask import Flask, render_template
  2. from Servo import *
  3. from time import sleep
  4.  
  5. ...
  6.  
  7. servos.enablePWMs(True)
  8.  
  9. print(servos.servos)
  10.  
  11. app = Flask(__name__)
  12. @app.route("/")
  13. @app.route("/<state>")
  14.  
  15. def updates(state=None):
  16.     if state == "Start":
  17.         servos.enablePWMs(True)
  18.  
  19. ...
  20.  
  21. template_data = {
  22.     "title" : state,
  23.     }
  24.     return render_template("quadruped.html", **template_data)
  25.  
  26. if __name__ == "__main__":
  27.     app.run(host="0.0.0.0", port=5000, debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement