Skip to content

Instantly share code, notes, and snippets.

View yeffrimic's full-sized avatar

Yeffri J. Salazar yeffrimic

View GitHub Profile
#define salida1 5
#define salida2 4
#define pwm 7
#define distanciaPorPulso 0.72 //mm
float distanciaEnMM = 0;
const int channelPinA = 2;
int PPR = 20;
/**
* @file Read_Battery_Level.ino
* @author Bernd Giesecke (bernd.giesecke@rakwireless.com)
* @brief Read charging level from a battery connected to the RAK5005-O base board
* Setup and main loop
* @version 0.1
* @date 2020-08-21
*
* @copyright Copyright (c) 2020
*
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <PubSubClient.h> // https://github.com/knolleary/pubsubclient/
#define BUILTIN_LED 2
#define CONNECTION_TOPIC "/F-litter/connection/status"
#define MQTT_RECONNECTIO_MS_TIME 5000
WiFiClient espClient;
PubSubClient mqttClient(espClient);
[{"id":"a241677a.9d4738","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"179753f7.20760c","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"4a78ebf0.d15904","type":"tab","label":"Parqueo numero 1","disabled":false,"info":""},{"id":"99d0814b.e11998","type":"tab","label":"Parqueo numero 2","disabled":false,"info":""},{"id":"804cbfdd.656098","type":"tab","label":"Parqueo 4","disabled":false,"info":""},{"id":"7b263e23.89435","type":"tab","label":"Parqueo numero 5","disabled":false,"info":""},{"id":"86c345a4.6cf3","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"2d8659eb.6e387e","type":"mqtt-broker","z":"","name":"","broker":"broker.mqttdashboard.com","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"3170f1cb.a82eb6","type":"ui_tab","z":"","name":"Klappit 01","icon":"da
/*
* RFID wemos
*
* feb 2020
* Yeffrimic,Xibalba Hackerspace.
*
*/
#include <SPI.h>
#include <MFRC522.h>
/*
Sensor de gas
Este sketch tiene conectado a un pin digital
un sensor mq2 que puede detectar el humo en el ambiente
*/
#include <ESP8266WiFi.h>
[
{
"id": "443a255c.e61854",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": ""
},
{
"id": "f3a59ec7.9dc1d",
/*
Magnetic door sensor with time alarm
This sensor sends alerts when the door was opened, closed and when
the time alarm was exceeded
**next steps, use the wifimanager with custom parameters to update
the alarm time.
when there is no internet save the times went opened, closed and the time alarm
/*
Sensores flexibles
Este sketch es un ejemplo de como hacer
que nuestro dispositivo trabaje con cualquier
sensor digital booleano, es decir todo aquel sensor que cambie
su estado cuando detecta algo, o pasa el umbral
*/
[{"id":"cafd679a.f97188","type":"ui_button","z":"e9d07bbd.7b2858","name":"","group":"81663b62.2c0d78","order":0,"width":0,"height":0,"passthru":false,"label":"submit","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"submit","x":278.99998474121094,"y":1804.999984741211,"wires":[["55d671c0.b45048"]]},{"id":"504f598.eee46a8","type":"ui_text_input","z":"e9d07bbd.7b2858","name":"","label":"message","tooltip":"","group":"81663b62.2c0d78","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"message","x":275.99998474121094,"y":1850.999984741211,"wires":[["55d671c0.b45048"]]},{"id":"55d671c0.b45048","type":"function","z":"e9d07bbd.7b2858","name":"","func":"context.msg = context.msg || {};\n\nswitch (msg.topic){\n case 'message':\n context.msg.payload = msg.payload;\n break;\n case 'submit':\n if(context.msg.payload){\n return context.msg;\n }\n}","outputs":1,"noerr":0,"x":477.99998474121094,"y":1829.199996