Skip to content

Instantly share code, notes, and snippets.

View arduitronics's full-sized avatar

arduitronics

View GitHub Profile
@arduitronics
arduitronics / phsensor_as00050.ino
Created April 9, 2024 07:40
Arduitronics sample code for ph sensor as00050
// Arduitronics.com
long phTot;
float phAvg;
int i;
float m = (7-9.18)/(563-513); // Slope of straight line (Y = mx + C)
float C = 7-m*(563); //Constant of straight line (Y = mx + C)
void setup() {
Serial.begin(9600);
@arduitronics
arduitronics / cayenneOTAA.py
Last active May 21, 2022 08:04
การใช้งานบอร์ด TTGO LoRa 923MHz เพื่ออ่านข้อมูลจาก DHT11 และส่งข้อมูลขึ้น Console Helium และใช้งาน Cayenne mydevices เพื่อแสดงค่า
/*******************************************************************************
* Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
*
* Permission is hereby granted, free of charge, to anyone
* obtaining a copy of this document and accompanying files,
* to do whatever they want with them without any restriction,
* including, but not limited to, copying, modification and redistribution.
* NO WARRANTY OF ANY KIND IS PROVIDED.
*
* This example sends a valid LoRaWAN packet with payload "Hello,
#include <ArduinoJson.h> // **
#include <ESP8266WiFi.h>
#include <MicroGear.h>
float sensorValue = 0.1;
const int sleepTimeS = 30*60; // second
//-------------------------------------------------------
const char* ssid = "GJ Tech_xxxx";
const char* password = "xxxxxxxx";
@arduitronics
arduitronics / ExtremeLowPowerESP12F.ino
Last active July 25, 2021 09:21
ESP-12F กับ Extreme Sleep Mode 3 μA (ตอนที่ 2)
#include <ESP8266WiFi.h>
int holdPin = 0; // defines GPIO 0 as the hold pin (will hold CH_PD high untill we power down).
int pirPin = 12; // defines GPIO 12 as the PIR read pin (reads the state of the PIR output).
int pir = 1; // sets the PIR record (pir) to 1 (it must have been we woke up).
void setup() {
pinMode(holdPin, OUTPUT); // sets GPIO 0 to output
digitalWrite(holdPin, HIGH); // sets GPIO 0 to high (this holds CH_PD high even if the PIR output goes low)
/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
// ตัวอย่างการใช้งาน Arduino MKR 1010 Wifi ดึงข้อมูลจาก website แบบ SSL
// โดย Arduitronics.com : Mountain A
// Data from https://www.tmd.go.th/en/province.php?StationNumber=48455
/*______Import Libraries_______*/
#include <SPI.h>
#include <WiFiNINA.h>
#include <ArduinoHttpClient.h>
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
/* This Arduino example demonstrates bidirectional operation of a
// 28BYJ-48, using a ULN2003
// interface board to drive the stepper. The 28BYJ-48 motor is a 4-
// phase, 8-beat motor, geared down by a factor of 68. One bipolar
// winding is on motor pins 1 & 3 and the other on motor pins 2 & 4.
//Arduino 1.0+ only
#include <Wire.h>
#define CTRL_REG1 0x20
#define CTRL_REG2 0x21
#define CTRL_REG3 0x22
#define CTRL_REG4 0x23
#define CTRL_REG5 0x24
int L3G4200D_Address = 105; //I2C address of the L3G4200D
int x;
int y;
// Example Sketch by Arduitronics.com for testing GY-30 Module
// Ambient Light sensor -- GY-30
// Feb 22, 2014
// By Mountain A
#include <Wire.h> //BH1750 IIC Mode
#include <math.h>
//int BH1750address = 0x5C; // ADDR -> VCC Measurement with L-Resolution Mode
int BH1750address = 0x23; // ADDR -> GND Measurement with H-Resolution Mode2