#include<p18f4520.h>
//#include"sutures_gloves_testing.h"
#pragma config OSC = HS //INTOSC_EC
#pragma config PWRT = OFF
#pragma config BOREN = OFF
#pragma config MCLRE = ON
#pragma config PBADEN = OFF
#pragma config LVP = OFF
#pragma config WDT = OFF //,DEBUG=OFF
#define LED1 (LATBbits.LATB3)
#define LED2 (LATBbits.LATB2)
#define LED3 (LATCbits.LATC5)
#define LED4 (LATCbits.LATC4)
#define SWITCH_1 (PORTAbits.RA4)
#define SWITCH_2 (PORTAbits.RA5)
#define SWITCH_3 (PORTEbits.RE0)
#define SWITCH_4 (PORTEbits.RE1)
#define Actuator_1 (LATAbits.LATA0)
#define Actuator_2 (LATAbits.LATA1)
#define Actuator_3 (LATAbits.LATA2)
#define Actuator_4 (LATAbits.LATA3)
#define Solenoid_1 (LATCbits.LATC2)
void All_init(void);
void main()
{
All_init();
Actuator_1 = 1;
Actuator_2 = 1;
Actuator_3 = 1;
Actuator_4 = 1;
while(1)
{
if(SWITCH_1 == 0)
{
Actuator_1 = 0;
}
if(SWITCH_2 == 0)
{
Actuator_2 = 0;
}
if(SWITCH_3 == 0)
{
Actuator_3 = 0;
}
if(SWITCH_4 == 0)
{
Actuator_4 = 0;
}
//Actuator_2 = 0;
}
}
void All_init()
{
TRISBbits.RB3 = 0;
TRISBbits.RB2 = 0;
TRISCbits.RC5 = 0;
TRISCbits.RC4 = 0;
TRISCbits.RC2 = 0;
TRISAbits.RA0 = 0;
TRISAbits.RA1 = 0;
TRISAbits.RA2 = 0;
TRISAbits.RA3 = 0;
TRISAbits.RA4 = 1;
TRISAbits.TRISA5 = 1;
TRISEbits.RE0 = 1;
TRISEbits.RE1 = 1;
}