This file contains hidden or 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<WiFi.h> | |
| #define WIFI_STA_NAME "xxxxxxxxxx" | |
| #define WIFI_STA_PASS "xxxxxxxxxx" | |
| #define LED_PIN 23 | |
| WiFiServer server(80); | |
| void setup() { |
This file contains hidden or 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 <WiFi.h> | |
| #include <HTTPClient.h> | |
| #define WIFI_STA_NAME "xxxxxxxxxx" | |
| #define WIFI_STA_PASS "xxxxxxxxxx" | |
| void setup() { | |
| Serial.begin(115200); | |
| pinMode(LED_BUILTIN, OUTPUT); |
This file contains hidden or 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 <WiFi.h> | |
| #include <HTTPClient.h> | |
| #define WIFI_STA_NAME "xxxxxxxxxx" | |
| #define WIFI_STA_PASS "xxxxxxxxxx" | |
| void setup() { | |
| Serial.begin(115200); | |
| pinMode(LED_BUILTIN, OUTPUT); |
This file contains hidden or 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 <WiFi.h> | |
| #include <HTTPClient.h> | |
| #define WIFI_STA_NAME "xxxxxxxxxx" | |
| #define WIFI_STA_PASS "xxxxxxxxxx" | |
| const char* ca = \ | |
| "-----BEGIN CERTIFICATE-----\n" \ | |
| "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n" \ | |
| "MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \ |
This file contains hidden or 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 <WiFi.h> | |
| #include <PubSubClient.h> | |
| #define WIFI_STA_NAME "xxxxxxxxxx" | |
| #define WIFI_STA_PASS "xxxxxxxxxx" | |
| #define MQTT_SERVER "m11.cloudmqtt.com" | |
| #define MQTT_PORT 10384 | |
| #define MQTT_USERNAME "esp32_1" | |
| #define MQTT_PASSWORD "123456" |
This file contains hidden or 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
| mkdir ./Documents/Arduino/hardware/espressif -p && cd ./Documents/Arduino/hardware/espressif && git clone https://github.com/espressif/arduino-esp32.git esp32 |
This file contains hidden or 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
| #define LED1 LED_BUILTIN | |
| #define LED2 23 | |
| unsigned long last1, last2; | |
| void setup() { | |
| pinMode(LED1, OUTPUT); | |
| pinMode(LED2, OUTPUT); | |
| } |
This file contains hidden or 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
| #define LED1 LED_BUILTIN | |
| #define LED2 23 | |
| hw_timer_t *timer = NULL; | |
| void onTimer(){ | |
| digitalWrite(LED2, !digitalRead(LED2)); | |
| } | |
| void setup() { |
This file contains hidden or 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
| #define LED1 LED_BUILTIN | |
| #define LED2 23 | |
| void LEDTwo_Task(void *p){ | |
| pinMode(LED2, OUTPUT); | |
| while(1) { | |
| digitalWrite(LED2, !digitalRead(LED2)); | |
| delay(300); | |
| } | |
| } |
This file contains hidden or 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
| /* | |
| Blink | |
| Turns on an LED on for one second, then off for one second, repeatedly. | |
| Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO | |
| it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to | |
| the correct LED pin independent of which board is used. | |
| If you want to know what pin the on-board LED is connected to on your Arduino model, check | |
| the Technical Specs of your board at https://www.arduino.cc/en/Main/Products | |