Skip to content

Instantly share code, notes, and snippets.

/*
The MIT License (MIT)
Copyright (c) 2023 tueddy (Dirk Carstensen)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
void showESPInfo() {
Serial.println("AllNewStep TESTER");
Serial.println( "Hardware Info..." );
Serial.printf( "- ESP chip model : %s\n",
ESP.getChipModel() );
Serial.printf( "- Chip revision : %u\n",
ESP.getChipRevision() );
Serial.printf( "- No. of cores : %u\n",
ESP.getChipCores() );
// ติดตั้งไลบารีที่นี่ https://github.com/sparkfun/SparkFun_MPU-9250-DMP_Arduino_Library/tree/master
// VCC - 5V
// GND - GND
// SDA - A4
// SCL - A5
#include <Wire.h>
#include <SparkFunMPU9250-DMP.h>
MPU9250_DMP imu;
#include <Wire.h>
#define ADXL345_ADDRESS (0x53) // ADXL345 accelerometer address
#define ITG3205_ADDRESS (0x68) // ITG3205 gyroscope address
#define HMC5883L_ADDRESS (0x1E) // HMC5883L magnetometer address
void setup() {
Serial.begin(9600);
Wire.begin();
#include <Wire.h>
#include "Adafruit_CCS811.h"
#include "Adafruit_HDC1000.h"
Adafruit_CCS811 ccs;
Adafruit_HDC1000 hdc;
void setup() {
Serial.begin(9600);
Serial.println("CCS811 HDC1080 Example");
// กำหนดขาที่เชื่อมต่อกับ E3F-DS300C1
const int sensorPin = 2; // แก้ไขตามขาที่คุณใช้
void setup() {
// กำหนดขาเป็นขานำเข้า
pinMode(sensorPin, INPUT);
// เปิด Serial Monitor
Serial.begin(9600);
}
#include <Wire.h>
#include <Adafruit_ADXL345_U.h>
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified();
void setup() {
Serial.begin(9600);
if(!accel.begin()) {
Serial.println("Could not find a valid ADXL345 sensor, check wiring!");
while(1);
const int sensorPin = 2; // ต่อเข้ากับขาของ Infrared Barrier Tracking Module
int sensorStatus = 0; // ตัวแปรเก็บสถานะของเซนเซอร์
void setup() {
pinMode(sensorPin, INPUT); // กำหนดขา sensorPin เป็น INPUT
Serial.begin(9600); // เริ่มการสื่อสารผ่าน Serial ที่ความเร็ว 9600 bps
}
void loop() {
sensorStatus = digitalRead(sensorPin); // อ่านค่าจากเซนเซอร์
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/*
การต่อขาจอ LCD กับ UNO
VCC - 5V
GND - GND
SDA - A4
SCL - A5
การต่อขา Ultrasonic กับ UNO
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/*
การต่อขาจอ LCD กับ UNO
VCC - 5V
GND - GND
SDA - A4
SCL - A5
การต่อขา Ultrasonic กับ UNO