my supervisor ask me to use other looping command but i dont know what else to do(this job is not my field actually)..i need ur help to use other command(looping) for this code :
#include <16F84A.h>
#USE DELAY( CLOCK=4000000 ) /* Using a 4 Mhz clock */
#FUSES XT,NOWDT,NOPROTECT,NOPUT
/* Use XT mode, No Watch Dog, No Code Protect, No Power-up Timer */
#byte port_a=5/* define the location of register port_a */
#byte port_b=6 /* define the location of register port_b */
main(){
int cnt, value, Junc;
set_tris_a(0); /* set port_a to be outputs */
set_tris_b(0); /* set port_b to be outputs */
port_a = 0; /* initialize All port_b outp/uts to be zero */
port_b = 0; /* initialize All port_b outp/uts to be zero */
value = 0x01;
while( TRUE )
{ /* forever loop using WHILE construct */
cnt = 1;
value = 0x01;
while ( cnt<9 )
{
for (;Junc; )
{
port_b = 0x10;
port_a =0x0E;
Delay_MS(8000);
port_b = 0x01;
port_a =0x0E;
Delay_MS(2000);
port_b = 0x00;
port_a =0xFF;
Delay_MS(2000);
port_b = 0x20;
port_a = 0x0D;
Delay_MS(8000);
port_b = 0x02;
port_a = 0x0D;
Delay_MS(2000);
port_b = 0x00;
port_a =0x0F;
Delay_MS(2000);
port_b = 0x40;
port_a = 0x0B;
Delay_MS(8000);
port_b = 0x04;
port_a = 0x0B;
Delay_MS(2000);
port_b = 0x00;
port_a =0x0F;
Delay_MS(2000);
port_b = 0x80;
port_a = 0x07;
Delay_MS(8000);
port_b = 0x08;
port_a = 0x07;
Delay_MS(2000);
port_b = 0x00;
port_a = 0xFF;
Delay_MS(8000);
}
Delay_MS(2000);
value = value << 1; /* shift left will put 0x01, 0x02, 0x04, 0x08, 0x10 */
cnt++; /* 0x20, 0x40, 0x80 to port_a */
}
}
}
need ur help.....
#include <16F84A.h>
#USE DELAY( CLOCK=4000000 ) /* Using a 4 Mhz clock */
#FUSES XT,NOWDT,NOPROTECT,NOPUT
/* Use XT mode, No Watch Dog, No Code Protect, No Power-up Timer */
#byte port_a=5/* define the location of register port_a */
#byte port_b=6 /* define the location of register port_b */
main(){
int cnt, value, Junc;
set_tris_a(0); /* set port_a to be outputs */
set_tris_b(0); /* set port_b to be outputs */
port_a = 0; /* initialize All port_b outp/uts to be zero */
port_b = 0; /* initialize All port_b outp/uts to be zero */
value = 0x01;
while( TRUE )
{ /* forever loop using WHILE construct */
cnt = 1;
value = 0x01;
while ( cnt<9 )
{
for (;Junc; )
{
port_b = 0x10;
port_a =0x0E;
Delay_MS(8000);
port_b = 0x01;
port_a =0x0E;
Delay_MS(2000);
port_b = 0x00;
port_a =0xFF;
Delay_MS(2000);
port_b = 0x20;
port_a = 0x0D;
Delay_MS(8000);
port_b = 0x02;
port_a = 0x0D;
Delay_MS(2000);
port_b = 0x00;
port_a =0x0F;
Delay_MS(2000);
port_b = 0x40;
port_a = 0x0B;
Delay_MS(8000);
port_b = 0x04;
port_a = 0x0B;
Delay_MS(2000);
port_b = 0x00;
port_a =0x0F;
Delay_MS(2000);
port_b = 0x80;
port_a = 0x07;
Delay_MS(8000);
port_b = 0x08;
port_a = 0x07;
Delay_MS(2000);
port_b = 0x00;
port_a = 0xFF;
Delay_MS(8000);
}
Delay_MS(2000);
value = value << 1; /* shift left will put 0x01, 0x02, 0x04, 0x08, 0x10 */
cnt++; /* 0x20, 0x40, 0x80 to port_a */
}
}
}
need ur help.....