Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
#include "OThreadCLI.h"
void setup() {
Serial.begin(115200);
OThreadCLI.begin(false); // No AutoStart - fresh start
// Start Console
Serial.println("OpenThread CLI started - type 'help' for a list of commands.");
OThreadCLI.startConsole(Serial);
@maxpromer
maxpromer / platformio.ini
Created July 31, 2024 18:23
platformio.ini for ATD3.5-S3 (Arduino Core of ESP32 V3.x.x)
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
/*
Rui Santos
Complete project details at https://RandomNerdTutorials.com/esp32-date-time-ntp-client-server-arduino/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/
/*
This sketch shows the Ethernet event usage
*/
#include <Arduino.h>
#include <ATD3.5-S3.h>
#include <ETH.h>
#include <SPI.h>
#include <Adafruit_NeoPixel.h>
#define PIN 6 // กำหนดพินที่เชื่อมต่อกับ WS2812
#define NUMPIXELS 16 // กำหนดจำนวน LED ที่ใช้
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pixels.begin(); // เริ่มต้นการทำงานของไลบรารี
}
#define IN1_PIN 6 // กำหนดขาต่อ IN1 เป็นขา 6
#define IN2_PIN 5 // กำหนดขาต่อ IN2 เป็นขา 5
void soft_start(int pin, int start, int end) {
if (start < end) {
for (int i=start;i<=end;i++) {
analogWrite(pin, i);
delay(5);
}
} else if (start > end) {
#include <POP32.h>
void setup()
{
}
void loop()
{
motor(1,30);
motor(2,30);
delay(3000);
#define IN1_PIN 6 // กำหนดขาต่อ IN1 เป็นขา 6
#define IN2_PIN 5 // กำหนดขาต่อ IN2 เป็นขา 5
void setup() {
pinMode(IN1_PIN, OUTPUT); // กำหนดขาที่ IN1 เป็น OUTPUT
pinMode(IN2_PIN, OUTPUT); // กำหนดขาที่ IN2 เป็น OUTPUT
}
void loop() {
// กำหนดให้มอเตอร์หมุนตามเข็ม
#define IN1_PIN 8 // กำหนดขาต่อ IN1 เป็นขา 8
#define IN2_PIN 7 // กำหนดขาต่อ IN2 เป็นขา 7
#define PWM_PIN 6 // กำหนดขาต่อ PWM เป็นขา 6
void setup() {
pinMode(IN1_PIN, OUTPUT); // กำหนดขาที่ IN1 เป็น OUTPUT
pinMode(IN2_PIN, OUTPUT); // กำหนดขาที่ IN2 เป็น OUTPUT
pinMode(PWM_PIN, OUTPUT); // กำหนดขาที่ PWM เป็น OUTPUT
}
#include <ModbusMaster.h>
#define RS485_RX_PIN (27)
#define RS485_TX_PIN (26)
ModbusMaster sensor;
void setup() {
Serial.begin(115200);