This file contains 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 OUT_PIN A0 | |
void setup() { | |
Serial.begin(9600); | |
} |
This file contains 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 Trig_PIN 12 | |
#define Echo_PIN 13 | |
void setup() { | |
pinMode(Trig_PIN, OUTPUT); | |
pinMode(Echo_PIN, INPUT); |
This file contains 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
/* | |
* File: main.c | |
* Author: max30012540@hotmail.com | |
* | |
* Created on 3/18/2017 8:09:13 AM UTC | |
* "Created in MPLAB Xpress" | |
* Full code you can see : https://mplabxpress.microchip.com/mplabcloud/example/details/306 | |
*/ | |
This file contains 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
unsigned long __pulseIn(int pin, int lavel) { | |
while(digitalRead(pin) != lavel) ; | |
unsigned long time_s = 0; | |
while(digitalRead(pin) == lavel) { | |
delayMicroseconds(1); | |
time_s++; | |
} | |
return time_s; | |
} |
This file contains 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 TX_PIN 2 // Pin connect to Tx | |
#define RX_PIN 3 // Pin connect to Rx | |
SoftwareSerial mySerial(RX_PIN, TX_PIN); // Rx, Tx |
This file contains 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
// Coding By IOXhop : www.ioxhop.com | |
#include <Servo.h> | |
Servo myservo; | |
#define UNLOCK_POS 5 | |
#define LOCK_POS 100 | |
void setup() { |
This file contains 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
// Coding By IOXhop : www.ioxhop.com | |
#include <Servo.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
#define UNLOCK_POS 5 | |
#define LOCK_POS 100 |
This file contains 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 <HLW8012.h> | |
#define SERIAL_BAUDRATE 9600 | |
// GPIOs | |
#define SEL_PIN 11 | |
#define CF1_PIN 13 | |
#define CF_PIN 12 | |
// Check values every 2 seconds |
This file contains 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
int sensorPin = 3; | |
int indicator = 13; | |
void setup() { | |
pinMode(sensorPin, INPUT); | |
pinMode(indicator, OUTPUT); | |
Serial.begin(9600); | |
} | |
void loop() { |
This file contains 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 <Wire.h> | |
#define BH1750_ADDR 0x23 | |
int readBH1750(byte dev_addr) { | |
Wire.beginTransmission(dev_addr); | |
Wire.write(0x10); | |
if (Wire.endTransmission() != 0) return -1; | |
delay(200); | |
Wire.requestFrom((int)dev_addr, 2); |