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 SCL_PIN 5 //Default SDA is Pin5 PORTC for the UNO -- you can set this to any tristate pin | |
| #define SCL_PORT PORTC | |
| #define SDA_PIN 4 //Default SCL is Pin4 PORTC for the UNO -- you can set this to any tristate pin | |
| #define SDA_PORT PORTC | |
| #define I2C_TIMEOUT 100 //Define a timeout of 100 ms -- do not wait for clock stretching longer than this time | |
| /* | |
| I have included a couple of extra useful settings for easy reference. | |
| //#define I2C_CPUFREQ (F_CPU/8)//Useful if you plan on doing any clock switching | |
| #define I2C_FASTMODE 1 //Run in fast mode (400 kHz) | |
| #define I2C_SLOWMODE 1 //If you do not define the mode it will run at 100kHz with this define set to 1 it will run at 25kHz |
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
| // Example testing sketch for various DHT humidity/temperature sensors | |
| // Written by ladyada, public domain | |
| // REQUIRES the following Arduino libraries: | |
| // - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library | |
| // - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor | |
| #include "DHT.h" | |
| #define DHTPIN 2 // Digital pin connected to the DHT sensor |
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
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(2, OUTPUT); | |
| pinMode(LED_BUILTIN, OUTPUT); | |
| } | |
| void loop() { | |
| Serial.println("ArduinoAll TESTED VERY EASY"); | |
| digitalWrite(2, 0); | |
| digitalWrite(LED_BUILTIN, LOW); | |
| delay(1000); |
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
| //ตัวส่ง ESP32 | |
| #include <esp_now.h> | |
| #include <WiFi.h> | |
| // แก้ไขค่า mac ตัวที่ต้องการส่งไปหา | |
| uint8_t broadcastAddress[] = {0xEC, 0x94, 0xCB, 0x6F, 0x11, 0x60};//ส่งไปหาเฉพาะ mac address | |
| //uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};//ส่งไปหาทุกตัว | |
| typedef struct struct_message { // สร้างตัวแปรแพ็จเกจแบบ struct | |
| char a[32]; |
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 <ESP8266WiFi.h> | |
| #include <DNSServer.h> | |
| #include <ESP8266WebServer.h> | |
| #include <WiFiManager.h> | |
| ESP8266WebServer server(80); | |
| void handleRoot() { | |
| server.send(200, "text/plain", "hello ALL esp8266!"); | |
| } |
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 <ESP8266WiFi.h> | |
| #include <DNSServer.h> | |
| #include <ESP8266WebServer.h> | |
| #include <WiFiManager.h> | |
| void setup() { | |
| // put your setup code here, to run once: | |
| Serial.begin(115200); | |
| WiFiManager wifiManager; | |
| Serial.println("Connecting..."); | |
| if (!wifiManager.startConfigPortal("All")) { |
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
| // สร้างโดย Allnewstep.com รายละเอียดเพิ่มเติมที่นี่ https://www.allnewstep.com/p/146 | |
| #include <Wire.h> | |
| #include <PN532_I2C.h> | |
| #include <PN532.h> | |
| #include <NfcAdapter.h> | |
| PN532_I2C pn532i2c(Wire); | |
| PN532 nfc(pn532i2c); | |
| void setup(void) { |
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 <SPI.h> | |
| #include <Wire.h> | |
| #include <Adafruit_GFX.h> | |
| #include <Adafruit_SSD1306.h> | |
| #define SCREEN_WIDTH 128 // pixel ความกว้าง | |
| #define SCREEN_HEIGHT 64 // pixel ความสูง | |
| // กำหนดขาต่อ I2C กับจอ OLED | |
| #define OLED_RESET -1 //ขา reset เป็น -1 ถ้าใช้ร่วมกับขา Arduino reset |
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 <SPI.h> | |
| #include <Wire.h> | |
| #include <Adafruit_GFX.h> | |
| #include <Adafruit_SH1106.h> | |
| #define OLED_RESET 4 | |
| Adafruit_SH1106 display(OLED_RESET); | |
| #define NUMFLAKES 10 | |
| #define XPOS 0 |
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
| ///////////////////////////////////////////////////////////////////////////////////////////////////// | |
| // BMP280_DEV - I2C Communications (Alternative Address), Default Configuration, Normal Conversion | |
| ///////////////////////////////////////////////////////////////////////////////////////////////////// | |
| #include <BMP280_DEV.h> // Include the BMP280_DEV.h library | |
| float temperature, pressure, altitude; // Create the temperature, pressure and altitude variables | |
| BMP280_DEV bmp280; // Instantiate (create) a BMP280_DEV object and set-up for I2C operation | |
| void setup() |