go away spammer

Author Topic: output not function..????  (Read 1653 times)

0 Members and 1 Guest are viewing this topic.

Offline necroqTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
output not function..????
« on: March 28, 2012, 09:41:27 AM »
 :'( :'( :'(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: 
Quote
#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;}


Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: output not function..????
« Reply #1 on: March 28, 2012, 10:24:27 AM »
What error messages do you get? Please copy and paste them (also, please use the CODE tags so it will be more readable). If you check the "Don't use smileys" checkbox when posting it won't mangle for loops and such.

Joe

Offline adanvasco

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 6
  • Necessity is the mother of invention.
Re: output not function..????
« Reply #2 on: March 31, 2012, 08:54:36 PM »
Errors? IDE? We need more details to be able to help.
Knowledge does not weigh.

 


Get Your Ad Here