Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
/*
* 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);
/*
* Codeing By IOXhop : www.ioxhop.com
*/
#define Trig_PIN 12 // Pin connect to Trig pin
#define Echo_PIN 13 // Pin connect to Echo pin
void setup() {
pinMode(Trig_PIN, OUTPUT);
pinMode(Echo_PIN, INPUT);
/*
* 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
/*
* Codeing By IOXhop : www.ioxhop.com
*/
#define OUT_PIN A0
void setup() {
Serial.begin(9600);
}
/*
* Codeing By IOXhop : www.ioxhop.com
*/
#define Trig_PIN 12
#define Echo_PIN 13
void setup() {
pinMode(Trig_PIN, OUTPUT);
pinMode(Echo_PIN, INPUT);
/*
* 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
*/
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;
}
// Coding By IOXhop : www.ioxhop.com
#include <Servo.h>
Servo myservo;
#define UNLOCK_POS 5
#define LOCK_POS 100
void setup() {
// 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
#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