Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
function doGet(e) {
Logger.log(JSON.stringify(e));
var result = 'Ok';
if ((!e) || e.parameter == 'undefined') {
result = 'No Parameters';
}
else {
var sheet_id = '10rTTvj3XmHhh2mrXOlFySaBB1DWFF-vXgEjziFkG56I'; // Spreadsheet ID
var sheet = SpreadsheetApp.openById(sheet_id).getActiveSheet();
var newRow = sheet.getLastRow() + 1;
/*
Web client
This sketch connects to a website (http://www.google.com)
using an Arduino WIZnet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
/*
* โค๊ดตัวอย่างการทดสอบการอ่านค่าเอ๊าต์พุทของเซนเซอร์วัดความชื้นในดิน Soil Stick
* และแปลงค่าเป็นส่วนกลับ ปรับให้อยู่ในสเกล0-10
* อ่านค่าแล้วแสดงผลทุกๆ 5 วินาที
* ทดสอบกับบอร์ด Arduino Uno
*
* 16 April 2020
* facebook fan page: เกษตรไทย IoT
*/
@maxpromer
maxpromer / thermal_cam.ino
Created March 6, 2024 10:34
Made Thermal Camera with ATD1.47-S3 & AS-AMG8853
#include <ATD1.47-S3.h>
#include <Wire.h>
#include <Adafruit_AMG88xx.h>
//low range of the sensor (this will be blue on the screen)
#define MINTEMP 22
//high range of the sensor (this will be red on the screen)
#define MAXTEMP 34
#include <Arduino.h>
#include <lvgl.h>
#include <ATD3.5-S3.h>
#include "gui/ui.h"
#include "driver/gpio.h"
#include "driver/twai.h"
#define CAN_TX_PIN GPIO_NUM_1
#define CAN_RX_PIN GPIO_NUM_2
#include <SPI.h>
#include <mcp2515.h>
MCP2515 mcp2515(10);
void setup() {
Serial.begin(115200);
mcp2515.reset();
mcp2515.setBitrate(CAN_125KBPS, MCP_8MHZ);
@maxpromer
maxpromer / ATD3.5-S3-NETPIE.cpp
Created January 31, 2024 13:54
ATD3.5-S3 x NETPIE
#include <Arduino.h>
#include <lvgl.h>
#include <ATD3.5-S3.h>
#include "gui/ui.h"
#include <WiFi.h>
#include <PubSubClient.h>
#define MQTT_SERVER "mqtt.netpie.io"
#define MQTT_PORT 1883
#define MQTT_CLIENT_ID "58dd3ff2-33e7-4203-8a83-528b65076fd9"
#include <ModbusMaster.h>
#define RS485_RX_PIN (15)
#define RS485_TX_PIN (17)
#define RS485_DIR_PIN (16)
ModbusMaster sensor;
void preTransmission() {
digitalWrite(RS485_DIR_PIN, HIGH);
@maxpromer
maxpromer / ATD3.5_S3_PMS7003.cpp
Created January 29, 2024 12:47
ATD3.5-S3 x PMS7003
#include <Arduino.h>
#include <lvgl.h>
#include <ATD3.5-S3.h>
#include "gui/ui.h"
#include <PMS.h>
PMS pms(Serial2);
PMS::DATA data;
bool pms_ok = false;
/* Dev by IOXhop.com */
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <driver/i2s.h>
const char *ssid = "";
const char *password = "";