:'(hello guys..am a electrical student being forced by lecturers to design a stairs climbing robot as my final year project...i need some help on my c program (am using pic16f877). this is how my robot will operate:
1)swicth on the robot
2)motors(3 motors) run and IR(active low) sensor also switched on
3)robot climbs the stairs
4)IR sense a line(active high) to stop the robot i dont know why this code cannot be build...REALLY NEED UR HELP.. above is my c program:
#include <pic.h>
#include <htc.h>
__CONFIG(0x3F32);
#define LED PORTB
#define _XTAL_FREQ 20000000
#define INPUT PORTA
void pic_init();
main()
{
int RA;
pic_init();//initialize PIC
for(;//loop forever
{
if(PORTA==0b000001)
{LED=0b10101010;}
else
{LED=0b01010101;}
}
}
void pic_init(){
TRISA=0b00000000;
TRISB=0b00000000;
TRISC=0b00000000;
TRISD=0b00000000;
TRISE=0b00000000;
ADCON1=0b00000110;
PORTA=0b00000000;
PORTB=0b00000000;
PORTC=0b00000000;
PORTD=0b00000000;
PORTE=0b00000000;}