load('api_config.js');
load('api_http.js');
load('api_gpio.js');
load('api_timer.js');
let button = 25;
GPIO.set_button_handler(button, GPIO.PULL_UP, GPIO.INT_EDGE_NEG, 200,
function() {
print("clicked!");
HTTP.query({
url: 'https://maker.ifttt.com/trigger/esp32/with/key/{your-key}',
headers: { },
data: {
event: 'esp32',
message: 'clicked!',
timestamp: Timer.now()
},
success: function(body, full_http_msg) { print(body); },
error: function(err) { print(err); },
});
}, null);