Bhavik Parikh
Published

Hello World For IoT: LED Blinking

LED blinking with cloud is first step towards IoT. In this project, we will see how to do it in a simple way.

AdvancedProtip832
Hello World For IoT: LED Blinking

Things used in this project

Hardware components

Odinub
Odinub
×1

Software apps and online services

Firebase
Google Firebase

Story

Read more

Code

blink.py

Python
This code will help you to get the real time value from firebase and control LED accordingly.
import firebase
import os

firebase=firebase.FirebaseApplication("https://XXXXXXXXXXXX.firebaseio.com/")      #change your filebase link with this    
while True:
        result=firebase.get("/LED",None)
        print(result)
        if result == "on":
                os.system("sh on.sh")
        else:
                os.system("sh off.sh")

Credits

Bhavik Parikh
5 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.