#include < xc.h >
// Definición de pines
#define RELAY1 PORTCbits.RC0
#define RELAY2 PORTCbits.RC1
#define BUTTON PORTBbits.RB5 // Pin para el botón (ajusta según tu conexión)
#define SWITCH1 PORTBbits.RB0 // Pin para el interruptor 1 (ajusta según tu conexión)
#define SWITCH2 PORTBbits.RB1 // Pin para el interruptor 2 (ajusta según tu conexión)
#define SWITCH3 PORTBbits.RB2 // Pin para el interruptor 3 (ajusta según tu conexión)
#define SWITCH4 PORTBbits.RB3 // Pin para el interruptor 4 (ajusta según tu conexión)
#define SWITCH5 PORTBbits.RB4 // Pin para el interruptor 5 (ajusta según tu conexión)
// Variables globales
bit buttonPressed = 0; // Indicador de botón presionado
void delay_ms(unsigned int ms);
void main() {
// Configuración de puertos
TRISB = 0b00111111; // Puerto B como entrada (RB5 es el botón y RB0-RB4 son los interruptores)
TRISC = 0b00000000; // Puerto C como salida (relés)