MOHAN KRISHNA

0 %
Mohan Krishna
Multimedia Professional
Ai & ML Researcher & Enthusiast
  • Residence:
    India
  • City:
    Vijayawada
  • Age:
    46
AI/ML Enthusiast. New Media Trainer, VFX Artist, Non Linear Video Editor, Graphic Designer, Sound Editor and iOS App Designer.
Telugu
English
Hindi
Tamil
Proficiency:
Graphic Design
Web Design
Video & VFX
Machine Learning
Artificial Intelligence
Digital Marketing
Areas of Interest:
Take a look at some of the things I love working on.
  • Non Linear Video Editing
  • Graphic Design
  • Web Design
  • Audio Editing
  • Content Management Systems
  • Python
  • Deep Learning
  • OpenCV
  • Image Classification

Raspberry-Pi-Sonoff

October 29, 2022
from flask import Flask, render_template, request, redirect
from gpiozero import LED
from time import sleep
led = LED(2)
# http://www.pillalamarri.in/python/raspberry-pi-sonoff/
app = Flask(__name__)

@app.route("/")

def home():
    if led.value == 1:
        status = 'ON'
    else:
        status = 'OFF'
    return render_template('home.html', status=status)


@app.route("/on")

def on():
    led.on()
    return "LED on"

@app.route("/off")

def off():
    led.off()
    return "LED off"

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8000) 

# http://www.pillalamarri.in/python/raspberry-pi-sonoff/
Posted in PythonTags: