Skip to content

Instantly share code, notes, and snippets.

View chepecarlos's full-sized avatar

Jose Carlos Garcia Diaz chepecarlos

View GitHub Profile
@chepecarlos
chepecarlos / demo.ino
Created April 12, 2023 21:00
demo de ctbot
// Creado ChepeCarlos
// Tutorial Completo en https://nocheprogramacion.com
// Canal Youtube https://youtube.com/alswnet?sub_confirmation=1
template<class T> inline Print &operator <<(Print &obj, T arg) {
obj.print(arg);
return obj;
}
#define EEPROM_SIZE 12
@chepecarlos
chepecarlos / mosquitto.conf
Created January 12, 2023 22:55
Configuraciones de Mosquitto
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
@chepecarlos
chepecarlos / DemoTelegram.ino
Created May 16, 2022 22:24
Demo de Telegram
template<class T> inline Print &operator <<(Print &obj, T arg) {
obj.print(arg);
return obj;
}
#include "CTBot.h"
CTBot miBot;
#include "token.h"
@chepecarlos
chepecarlos / Semaforo.ino
Last active March 29, 2022 23:54
Codigo de Semafoto
#include <EEPROM.h>
#define CantidadLed 3
int Led[CantidadLed] = {5, 4, 13};
int Espera[CantidadLed] = {10, 8, 2};
String ColorSemaforo[CantidadLed] = {"Rojo", "Verde", "Amarillo"};
#define Rojo 0
#define Verde 1
#define Amarillo 2
@chepecarlos
chepecarlos / Fechas.ino
Created March 21, 2022 00:22
Codigo de Ejemplos de Fechas
int Siglo = 6, Anno_4 = 5, Anno_7 = 1;
int Suma, Modulo;
int Dia, Mes;
int clave;
const int EsperaLed = 3000;
#define CantidadLed 7
const int claveMes[12] = {0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5};
const int Led[CantidadLed] = {8, 7, 6, 5, 4, 3, 2};
const String NombreDia[7] = {"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"};
//Bluetooth
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
#define Apagado 0
#define Encendido 1
#define Interminente 2
struct SuperLed {
@chepecarlos
chepecarlos / demoBluetooth.ino
Created June 26, 2021 04:15
Codigo de ayuda
#include "BluetoothSerial.h"
#include "Wire.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
const int MPU_ADDR = 0x68;
@chepecarlos
chepecarlos / Demo_Agregar_Blender.py
Last active May 31, 2021 04:10
Demo Agregar en Blender
import bpy, os
bl_info = {
"name": "pollo con papas",
"category": "Object",
}
def ShowMessageBox(message = "", title = "Message Box", icon = 'INFO'):
def draw(self, context):
@chepecarlos
chepecarlos / Demo_Addon_Blender.py
Last active May 31, 2021 03:01
Primer Demo de prueba echo en blender :)
# base https://docs.blender.org/api/blender_python_api_2_65_5/info_tutorial_addon.html
bl_info = {
"name": "pollo con papas",
"category": "Object",
}
import bpy
class ObjectCursorArray(bpy.types.Operator):
@chepecarlos
chepecarlos / Codigo.ino
Created March 23, 2021 20:55
Codigo con inicio raro
include <AFMotor.h> //libreria adafrit motor(shield)
#include <NewPing.h> //librería para sensor ultrasónico
#include <Servo.h> //libreria para servomotores
#define TRIG_PIN A0 //TRIG en pin A0
#define ECHO_PIN A1 //ECO en pin A1
#define MAX_DISTANCE 200 //distancia maxima de lectura
#define MAX_SPEED 190 //potencia mexima del motor
#define MAX_SPEED_OFFSET 20
NewPing sonar(TRIG_PIN, ECHO_PIN, MAX_DISTANCE);
AF_DCMotor motor1(1, MOTOR12_1KHZ); //motor conectado al conector 1 a frecuencia de 1 KHZ