A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By mattyams
#73279 So I want to take this idea http://www.simpleiothings.com/build-a-10-wifi-smart-button/ and this idea/3d print https://mylifeasa.tinkerer.us/philips-hue-remote-using-esp8266-6afaf76ac8a8 and put them together to be able to track my hours when working from home.

I have the code for sending button presses to IFTTT > Google Sheets figured out. My problem is the LED for the box and how I want it to work. I am at a complete loss on how to code it. Basically I have an RGB LED and I want it to blink blue a few times when first pressed, then stay steady red until pressed again then flash green.

Is there a way to do this with just an ESP8266, a button and an RGB LED?
User avatar
By Luc Volders
#73328 piece of cake.

Look at ESP-Basic which has its home on this forum. You can do this in a few minutes coding.

Look at interrupts with ESP-Basic.
When a button is pressed an interrupt is generated.
Interrupt routine sends to IFTTT
And the routine sets the color of the led.

For a quick tutorial that handles IFTTT and shows how to flash Neopixels (RGB led) you can look at my weblog:

http://lucstechblog.blogspot.nl/2017/03 ... p8266.html

Using that as a base most work will already be done.

Luc
User avatar
By mattyams
#73440 So I have gotten to the point to where I can get IFTTT to accept the trigger and the LEDs to flash when first pushed then keep flashing after. I am hung up on how to "turn it off" so to speak. Here is what I got so far. (I understand the "loop until 0" is infinite loops, I just know know what to code to get it to "stop")

Code: Select allio(po,d1,0)
io(po,d2,0)
io(po,d4,0)
interrupt d3, [start]
wait

[start]
io(laststat,d3) = 1
io(po,d1,1)
delay 500
io(po,d1,0)
delay 500
io(po,d1,1)
delay 500
io(po,d1,0)
print wget("maker.ifttt.com/trigger/button_pressed/with/key/cA5NcIsbXndi_RtfBfGrRB?value1=1&value2=two&value3=333")
delay 500
do
  io(po,d4,1)
  delay 500
  io(p0,d4,0)
  delay 500
loop until 0