WebThingsIO / webthing-arduino

Simple server for ESP8266, ESP32, Ethernet, or WiFi101-compatible boards compliant with Mozilla's proposed WoT API
Mozilla Public License 2.0
207 stars 78 forks source link

Arduino device (esp8266) Add events to PushButton #132

Open rarno opened 3 years ago

rarno commented 3 years ago

Hello, please excuse my bad English. I also need help with "PressedEvent". Unfortunately, in the examples "Update LEDLamp example to use actions & events. (# 101)" I cannot find any instructions on "Events". I cannot correctly adapt the "Event" "Overheated" in the example "LEDLamp" to a "pressedEvent". I'm trying a "flip-flop implementation" like in "# 694". Do you have an example for me to learn more?

kgiori commented 3 years ago

Since you're using an ESP8266, you might want to try the MicroBlocks WebThings library -- easier to use than the Arduino library and the pressed events work fine. There are examples in the MicroBlocks IDE that work "right out of the box", including a pushbutton example. See: http://microblocks.fun/ and http://microblocks.fun/iot.html

If you need any help, I'm on the chat channel and forum too.

rarno commented 3 years ago

Thank you for your message. I have prepared various settings such as network address etc. and its running. I also have other sensors and actuators in the same device (ESP). That's why I want to keep using the Arduino IDE

mrstegeman commented 3 years ago

Why can you not adapt the LEDLamp example?

rarno commented 3 years ago

My knowledge is not enough. Pushed button is pressed, "Pressed Event" comes, information appears on the monitor, an LED can be switched on with it. The next time I press the button, nothing happens. A new event message only comes after I log out and log in again. What I am doing wrong?