yes it is good job iceqube
and for additiyon you add a line to do-while loop for port b
do
{
output_b(0xff);
delay_ms(100);
output_b(0x00);
delay_ms(100);
} while(true);
for addition
as usually i'm using ports' direct memmory adress for not changing everytime tris registers
for example i define portb as
#byte PortB = 0xf81
and
add to init routine
set_tris_b(0x00);
and send PortB=0xff
it is making data loading port so fast or opposite for input also
if you define set_tris_b(0b00001111) half of port is output half of input
this bit defined written is not avaliable in any compiler (IAR HITECH or MICROCHIP)
but for example if you want to test with a bit
you may define
#bit LED = 0xf81.0// it must be defined before than program ofcourse
and in init routine if you add set_tris_b(0x00);
after init routine
you may write test code as
while(1)
{LED++; delay_ms(100); }
that's all
and compiler selects correct instruction for the chip series
for example for 16 series it is changing led bit value with ex-or instruction
but for 18 series it is changing led value by toggle instruction
it means that compiler likes to write codes shortly
