You should alaredy have some basic knowledge about C programming.
Now:-
1. Write a program to blink 8 LED connected to portb one after another. Before trun on the next led off the previous one.
2. Do similar as above and this time when last LED is lit, blink in reverse...ie led 1 to 8 and 7 to 1 endlessly.
3. Blink 2 LED at a time for all 8 LED. 1,2, then 3,4...
Post you code here. If you have errors or have problems let us know.
PIC-Based Battery Monitor
-
My friends, as usual, drove me to craziness again and led me to design,
fabricate and test a smart battery monitor... The usual blinking lights and
so on.....
13 years ago
3 comments:
Yes sir... exercise noted and I will do my homework... please don't cane me if I fail...
I need feedback, am i too detailed or further explanation is needed or just right?
I know, I have a lot to learn.
int a = 1;
void main ()
{
TRISB = 0;
PORTB = 0;
while (1);
{
do
{
PORTB = a;
Delay_ms(100);
a <<= 1; //shift bit to the left
}
while(a<255);
a >>= 2; //stops bit 7 double flashing between do loops
do
{
PORTB = a;
Delay_ms(100);
a >>= 1;
}
while(a>1);
}
}
Post a Comment