Hi,
Can anyone explain the meaning of the code from the 2 example I posted below?
_________________________________________________________________
example 1:
/running light
#include <16f876A.h>
#use delay(clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTC=7
main()
{
set_tris_b(0);
set_tris_c(0);
do{
portb=0b11111111;
portc=0b11111111;
delay_ms(2000);
portb=0b01010101;
portc=0b01010101;
delay_ms(2000);
portb=0b10101010;
portc=0b10101010;
delay_ms(2000);
}while(1);
}
example 2:
//lcd message display
#include <16f876A.h>
#use delay(clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#define use_portb_lcd TRUE
#include<lcd.c>
#byte PORTB=6
#byte PORTC=7
main()
{
set_tris_b(0);
set_tris_c(0);
lcd_init();
do{
lcd_putc("\fWelcome to\n");
delay_ms(1000);
lcd_putc("**UNITEN**");
delay_ms(1000);
portb=0b10101010;
lcd_putc("\f*Nice Day!!*\n");
lcd_putc("BY: BIZCHIP");
delay_ms(2000);
}while(1);
}
_________________________________________________________________
From the examples, can someone explain the meaning of 'fuses hs, noprotect, nowdt, nolvp', 'byte PORTB=6', 'byte PORTC=7', 'set_tris_b(0)', the code '0b11111111' and the following code?
Thank you.
Can anyone explain the meaning of the code from the 2 example I posted below?
_________________________________________________________________
example 1:
/running light
#include <16f876A.h>
#use delay(clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTC=7
main()
{
set_tris_b(0);
set_tris_c(0);
do{
portb=0b11111111;
portc=0b11111111;
delay_ms(2000);
portb=0b01010101;
portc=0b01010101;
delay_ms(2000);
portb=0b10101010;
portc=0b10101010;
delay_ms(2000);
}while(1);
}
example 2:
//lcd message display
#include <16f876A.h>
#use delay(clock = 20000000)
#fuses hs, noprotect, nowdt, nolvp
#define use_portb_lcd TRUE
#include<lcd.c>
#byte PORTB=6
#byte PORTC=7
main()
{
set_tris_b(0);
set_tris_c(0);
lcd_init();
do{
lcd_putc("\fWelcome to\n");
delay_ms(1000);
lcd_putc("**UNITEN**");
delay_ms(1000);
portb=0b10101010;
lcd_putc("\f*Nice Day!!*\n");
lcd_putc("BY: BIZCHIP");
delay_ms(2000);
}while(1);
}
_________________________________________________________________
From the examples, can someone explain the meaning of 'fuses hs, noprotect, nowdt, nolvp', 'byte PORTB=6', 'byte PORTC=7', 'set_tris_b(0)', the code '0b11111111' and the following code?
Thank you.