Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16f877A Stepper Motor controller source code ( Need Help)

Status
Not open for further replies.

isuru66

New Member
Hi all,
i have try out above source code in MikroC.
but it provide 3 errors.. tell me whats wrong in this code….

void main()
{
TRISB = 0×00;
PORTB = 0×00;

//routine to move in one direction
for (i=0;i<50;i++)// increse i=50 no i=100 to cover double the distance
{
PORTB=0×80;
delay_ms(20);
PORTB=0×40;
delay_ms(20);
PORTB=0×20;
delay_ms(20);
PORTB=0×10;
delay_ms(20);
}

//routine to move in the other direction

for (i=0;i<50;i++) // increse i=50 no i=100 to cover double the distance
{
PORTB=0×10;
delay_ms(20);
PORTB=0×20;
delay_ms(20);
PORTB=0×40;
delay_ms(20);
PORTB=0×80;
delay_ms(20);
}
}

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

error message is

‘;’ expected but x found
internal error
internal error

i think errors are in line 3 o 11

please give me a solution…
 
You appear to be using some strange character instead of a lower case x.

You have,
TRISB = 0×00;
If I type the same I get,
TRISB = 0x00;

My x is different!!

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top