SHARE
TWEET

Untitled

a guest May 19th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <UniversalTelegramBot.h>
  2. #include <ESP8266WiFi.h>
  3. #include <WiFiClientSecure.h>
  4.  
  5. char ssid[] = "Yusar";
  6. char password[] = "123456seven";
  7. #define BOTtoken "727910556:AAE-6BTcOFv33VjVgNbqpXarP7Oj6Nk0no8"
  8. String chatid = "721205125";
  9.  
  10. WiFiClientSecure client;
  11. UniversalTelegramBot bot(BOTtoken, client);
  12.  
  13. void setup() {
  14.   Serial.begin(9600);
  15.   WifiStatus();
  16.  
  17.   bot.sendMessage(chatid, "Tes Kelas Robot");
  18.   Serial.println("Pesan Terkirim ke Telegram");
  19. }
  20.  
  21. void loop() {
  22.  
  23. }
  24.  
  25. void WifiStatus() {
  26.   WiFi.mode(WIFI_STA);
  27.   WiFi.disconnect();
  28.   delay(100);
  29.   Serial.print("Connecting Wifi: ");
  30.   Serial.println(ssid);
  31.   WiFi.begin(ssid, password);
  32.  
  33.   while (WiFi.status() != WL_CONNECTED) {
  34.     Serial.print(".");
  35.     delay(500);
  36.   }
  37.  
  38.   Serial.println("");
  39.   Serial.println("WiFi connected");
  40.   Serial.print("IP address: ");
  41.   Serial.println(WiFi.localIP());
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top