kgavionics
Full Member level 3
- Joined
- Jun 12, 2012
- Messages
- 167
- Helped
- 7
- Reputation
- 14
- Reaction score
- 11
- Trophy points
- 1,298
- Location
- Alberta.Canada
- Activity points
- 2,482
hi
i have this little program that turn on the first led on portb then it shifts the led to the left.The program works fine,except that the pic execute the first loop then it stops.How can run the loop for ever?
thanks in advance
i have this little program that turn on the first led on portb then it shifts the led to the left.The program works fine,except that the pic execute the first loop then it stops.How can run the loop for ever?
thanks in advance
Code:
#include <stdio.h>
#include <stdlib.h>
#include <p18f452.h>
#pragma config OSC = HS
#pragma config WDT = OFF
#pragma config LVP = OFF
void MSDelay(unsigned int);
void main(void)
{
TRISB = 0;
PORTB=0X01;
for(; ;) [COLOR="#FF0000"]// normally this loop is forever!!!!!!![/COLOR]
{
PORTB=PORTB<<1;
Delay10KTCYx(120);
}
}