This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); // เริ่มใช้งานไลบารี่ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
pinMode(PC13, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(PC13, HIGH); | |
delay(500); | |
digitalWrite(PC13, LOW); | |
delay(500); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mraa | |
import time | |
x = mraa.Gpio(203, raw=True) | |
x.dir(mraa.DIR_OUT) | |
while True: | |
x.write(1) | |
time.sleep(0.2) | |
x.write(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool getPosition(void) ; | |
void serialFlush(void) ; | |
#include <SoftwareSerial.h> | |
SoftwareSerial GPS(10, 11); // RX, TX | |
float latitude, longitude, speed; | |
void setup() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 |
OlderNewer