Skip to content

Instantly share code, notes, and snippets.

#include <unistd.h>
#include "sdkconfig.h"
#include "driver/gpio.h"
#define pinLED 4
#define ALTO 1
#define BAJO 0
double tiempoBajo = 0.1;
/* UART Echo Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <unistd.h>
@esmarr58
esmarr58 / compuerta_and.c
Created August 28, 2023 20:02
Compuerta AND 2 entradas para la ESP32-S3 expressif-SDK
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "sdkconfig.h"
@esmarr58
esmarr58 / blink.c
Created August 28, 2023 19:23
Blink example for esp32-s3 on expressif sdk, for embbed class 2023B, UdG, Cucei. Seminario de Sistemas Embebidos.
/*
*
Ejemplo en c++ para el uso del ADS1115 con un shield de adc de 4 canales para la raspberry PI 4 mas 4 entradas para PLC
Ruben Estrada Marmolejo. ruben.estrada@hetpro.com.mx
https://hetpro-store.com/shield-24v-para-raspberry-mas-adc-4ch
* Original:
https://github.com/WiringPi/WiringPi/blob/master/wiringPi/ads1115.c
* Para compilar: g++ -W -o ads1115 ads1115-wiringPi.cpp -lwiringPi
* Para ejecutar: ./ads1115
*
/*
Dr. Ruben Estrada Marmolejo
ruben.estrada@hetpro.com.mx
*/
#include <HardwareSerial.cpp>
#include <IWatchdog.h>
@esmarr58
esmarr58 / mcp23017-30A.cpp
Created August 7, 2023 18:04
WiringPi example to use mcp23017 with a 30A shield reley for a Raspberry PI 4.
/*
*
Ejemplo en c++ para el uso del MCP23017 con un shield de relevadores 8ch para la Raspberry PI 4
Ruben Estrada Marmolejo. ruben.estrada@hetpro.com.mx
https://hetpro-store.com/shield-relevadores-10a-para-raspberry/
* Original: http://wiringpi.com/extensions/i2c-mcp23008-mcp23017/
* Para compilar: g++ -W -o mcp23017-2 mcp23017-30A.cpp -lwiringPi
* Para ejecutar: ./mcp23017-2
*
/*
*
Ejemplo en c++ para el uso del ADS1115 con un shield de adc de 4 canales para la raspberry PI 4
Ruben Estrada Marmolejo. ruben.estrada@hetpro.com.mx
https://hetpro-store.com/shield-adc-4ch-para-raspberry
* Original:
https://github.com/WiringPi/WiringPi/blob/master/wiringPi/ads1115.c
* Para compilar: g++ -W -o ads1115 ads1115-wiringPi.cpp -lwiringPi
* Para ejecutar: ./ads1115
*
/*
*
Ejemplo en c++ para el uso del MCP23017 con un shield de relevadores 8ch para la Raspberry PI 4
Ruben Estrada Marmolejo. ruben.estrada@hetpro.com.mx
https://hetpro-store.com/shield-relevadores-10a-para-raspberry/
* Original: http://wiringpi.com/extensions/i2c-mcp23008-mcp23017/
* Para compilar: g++ -W -o mcp23017 mcp23017.cpp -lwiringPi
* Para ejecutar: ./mcp23017
#define sensorTemperatura 34
#define nSLEEP 13 //En Arduino pin8
#define STEP 12 //En Arduino pin9
#define DIR 14 //En Arduino pin10
#define NENBL 27 //En Arduino pin11
#define M1 26 //En Arduino pin12
volatile double voltajeSensor = 0;
volatile uint16_t paso = 0;
volatile long int numeroPasos = 0;