Skip to content

Instantly share code, notes, and snippets.

View yeffrimic's full-sized avatar

Yeffri J. Salazar yeffrimic

View GitHub Profile
#include <AFMotor.h> // Librería Adafruit Motor Shield
#include <SoftwareSerial.h> // Librería Software Serial
// Definir los motores conectados a los puertos M1 y M2
AF_DCMotor motor_izquierdo(1); // Motor en M1
AF_DCMotor motor_derecho(2); // Motor en M2
// Configurar Software Serial en pines A0 (RX) y A1 (TX)
SoftwareSerial bluetooth(A0, A1); // RX, TX
import os
import pygame
import sys
import pyttsx3
# Inicializar Pygame
pygame.init()
# Inicializar pyttsx3
engine = pyttsx3.init()
#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