Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
#define SW1 A0
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(SW1, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
#include <ESP8266WiFi.h>
#include <MicroGear.h>
const char* ssid = "{YOUR_WIFI_NAME}";
const char* password = "{YOUR_WIFI_PASSWORD}";
#define APPID "{NETPIE_APPNAME}"
#define KEY "{NETPIE_KEY}"
#define SECRET "{NETPIE_SECRET}"
#define ALIAS "esp8266"
// CounterSensorDisplay by IOXhop.com
#include <TM1637Display.h>
// Module connection pins (Digital Pins)
#define CLK 3 // กำหนดว่าขา CLK ต่ออยู่กับขา D3
#define DIO 2 // กำหนดว่าขา DIO ต่ออยุ่กับขา D2
#define D0Sensor 4 // กำหนดว่าขา D0 ของ Counter / Speed Sensor ต่ออยู่กับขา D4
TM1637Display display(CLK, DIO); // เริ่มใช้งานไลบารี่
echo "System update"
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
echo "Install tool and NodeJS Python"
apt-get install git build-essential nodejs-dev python-dev cmake automake Libpcre3 libpcre3-dev Byacc flex -y
echo "Install swig"
cd /root
#include "TimerOne.h"
int D1 = 8;
int D2 = 9;
int D3 = 10;
int D4 = 11;
int CommonAK = 2; // Common Anode set to 1, Common Cathode set to 2
int num[] = { 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F };
/*
* Codeing By IOXhop : www.ioxhop.com
*/
#include <SoftwareSerial.h>;
#define US100_TX_PIN 2
#define US100_RX_PIN 3
SoftwareSerial mySerial(US100_RX_PIN, US100_TX_PIN); // Rx, Tx
/*
* Codeing By IOXhop : www.ioxhop.com
*/
#define US100_Trig_PIN 12
#define US100_Echo_PIN 13
void setup() {
pinMode(US100_Trig_PIN, OUTPUT);
pinMode(US100_Echo_PIN, INPUT);
/*
* Codeing By IOXhop : www.ioxhop.com
*/
#define SRF05_Trig_PIN 12
#define SRF05_Echo_PIN 13
void setup() {
pinMode(SRF05_Trig_PIN, OUTPUT);
pinMode(SRF05_Echo_PIN, INPUT);