Software apps and online services
In this example we are using ESP8266-01 WiFi Module and on board WS2812 multicoloured led.
In this example we are using Blynk HTTP RESTful API. Blynk HTTP RESTful API allows to easily read and write values to/from Pins in Blynk apps and Hardware (microcontrollers and microcomputers like Arduino, Raspberry Pi, ESP8266, Particle, etc.).
Every PUT request will update Pin's state both in apps and on the hardware. Every GET request will return current state/value on the given Pin. We also provide simplified API so you can do updates via GET requests.
You can read on how to do it here http://docs.blynkapi.apiary.io/#reference/0/get-pin-value/write-pin-value-via-get?console=1
Please Note: Use your Auth Token number in url to get data from server.
In this example we have used ESP8266_Lib.h and BlynkSimpleShieldEsp8266.h library to make communication between arduino and Blynk HTTP RESTful API. We have used Heroku Deployment Application to receive tweet from our twitter handle and then this application sends get request to Blynk HTTP RESTful API.Setup:
- install all libraries from our Github Repository to enable this example to run.
- Create account on BLYNK and use your Auth Token number in code and url.
- You will need to modify the python code ,so that the tweet lamp works for you.
- You will need to paste the Blynk generated token key in the python code.Once that is done you need to commit the code to Heroku git hub account .
Please Refer the link for more information
For more information on how to write heroku script and deploy it go tohttps://github.com/tommeagher/heroku_ebooks
You will also need to copy the Twitter Key to the Python code
def connect(): api = twitter.Api(consumer_key=MY_CONSUMER_KEY, consumer_secret=MY_CONSUMER_SECRET, access_token_key=MY_ACCESS_TOKEN_KEY, access_token_secret=MY_ACCESS_TOKEN_SECRET) return api
- Enter correct Auth Token number.
- Virtual pin number in code and url must be same.
- Check jumper for WS2812b multicoloured led is connected properly.
Once you upload the code.The Tweet lamp will keep searching for tweets with tag name and the color .
Now you will have your own RGB mood lamp that responds to the Tweets on the twitter.