This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/sha256" | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"net/http" | |
"net/http/fcgi" | |
"encoding/json" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin | |
from neopixel import NeoPixel | |
import time, random | |
np = NeoPixel(Pin(5), 20, bpp=3) | |
step = 32 | |
def light_on(): | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mqtt import MQTTClient | |
import time | |
def pub(server, topic, messaage): | |
client = MQTTClient("ESP32_Client", server) | |
client.connect() | |
client.publish(bytearray(topic), bytearray(messaage)) | |
time.sleep(1) | |
client.disconnect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import ssl | |
def send_message(): | |
s = socket.socket() | |
ai = socket.getaddrinfo("slack.com", 443) | |
print("Address infos:", ai) | |
addr = ai[0][-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoJson.h> | |
#include <DHT.h> | |
#define DHTPIN 22 | |
#define DHTTYPE DHT11 | |
DHT dht(DHTPIN, DHTTYPE); | |
#include <WiFiClientSecure.h> | |
const char* ssid = ""; |