And this PCB is...?My instructor give us a project to build a line follower robot with the PIC 16F877A. And writing the source code using C programming.Can you help me guise. Im already done with my PCB LAYOUT..
I calculate you have 5 days to complete this project, but that includes Wednesday so call it 4 to 4.5 days. You best get started as no one will write this code for you.my instructor gave us until wednesday for last submission yet until now.. i dont have a program..
yes.. i need your help.. i used pic16f877a.. i need a code using C program.. i used also MPLAB IDE for that.
my instructor gave us until wednesday for last submission yet until now.. i dont have a program..
That's all well and good, but even if we were to (we aren't) write the program for you, you haven't given enough information to allow someone to be able to.5 leds, 5 sensor !!
Is that supposed to tell us how they are arranged? How they work? What their outputs are? How they are even connected to the robot?5 leds, 5 sensor !!
...Again, even if we were to write it for you (which, again, we won't), you have not given us enough information to even attempt to help you. Why don't you try making a table that lists all possible outputs from your sensors and their corresponding outputs: left, right, and forward, and any modifiers you may want to add to modify the strength of each output (e.g. hard right, slight left, etc.)?[...]I need a program that will run to as LEFT,RIGHT and FORWARD.
If you would like some help, take a few minutes and identify what you need help with, what information we need to know in order to provide said help, submit that information, and wait for a response.
"#include <xc.h>
__CONFIG (FOSC_HS & WDTE_OFF & PWRTE_OFF & BOREN_OFF & LVP_OFF & PROTECT);
#define FORWARD 0x09
#define RIGHT 0x08
#define LEFT 0x01
#define L_SENSOR 0x18
#define C_SENSOR 0x0E
#define R_SENSOR 0x03
#define Off 0x00
void turnLEFT();
void turnRIGHT();
void forward();
void blank();
void main()
{
ADCON1 = 7;
TRISD = 0x1F;
TRISB = 0x00;
PORTB = Off;
while(1)
{
if((PORTD&L_SENSOR)==L_SENSOR)
{
turnLEFT();
}
else if((PORTD&R_SENSOR)==R_SENSOR)
{
turnRIGHT();
}
else if((PORTD&C_SENSOR)==C_SENSOR)
{
forward();
}
else
{
blank();
}
}
}
void blank()
{
PORTB = FORWARD;
}
void turnLEFT()
{
PORTB = LEFT;
}
void forward()
{
PORTB = FORWARD;
}
void turnRIGHT()
{
PORTB = RIGHT;
}
void InitPWM(void)
{
TRISC1 = 0;
TRISC2 = 0;
CCP1CON = 0x0C;
CCP2CON = 0x0C;
PR2 = 0xFF;
T2CON = 0x01;
T2CON |= 0x04;
}
void SetPWMDutyCycle(unsigned int DutyCycle)
{
CCPR1L = DutyCycle>>2;
CCP1CON &= 0xCF;
CCP1CON |= (0x30&(DutyCycle<<4));
}
void SetPWMDutyCycle2(unsigned int DutyCycle)
{
CCPR2L = DutyCycle>>2;
CCP2CON &= 0xCF;
CCP2CON |= (0x30&(DutyCycle<<4));
}"
The code is pretty clear. What are you not understanding?[...]can you guys clear this code..??
You don't "use" this code in the UART module in the PIC microcontroller. Please read the datasheet.and also use in UART.?
So you are asking us to help you cheat?This is the code program of my classmate[...]
The last update from the OP indicates that today is the due date.my instructor gave us until wednesday for last submission yet until now.. i dont have a program..
by Jake Hertz
by Jake Hertz
by Duane Benson
by Jake Hertz