Generation

generate functionMon, 16 Jan 2023

Send message in telegram account

#include <Arduino.h> #include <ESP8266WiFi.h> #include <ThingerESP8266.h> #define USERNAME "user_name" #define DEVICE_ID "device_id" #define DEVICE_CREDENTIAL "device_credential" #define SSID "ssid" #define SSID_PASSWORD "password" ThingerESP8266 thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL); void setup() { Serial.begin(115200); thing.add_wifi(SSID, SSID_PASSWORD); thing["send_message"] << digitalPin(5); thing["send_message"] |= [](){ thing.call_endpoint("send_message"); }; } void loop() { thing.handle(); }

Questions about programming?Chat with your personal AI assistant