mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
In this configuration, LED will emit light when voltage on pin is high (5V), and
will be off when voltage on pin is low (0V). We have to designate PORTB pins as
output, and change its value every second. Listing of program is below
program My_LED
main:
TRISB = 0
' configure pins of PORTB as output
eloop:
PORTB = $FF
' turn on diodes on PORTB
delay_ms(1000)
' wait 1 second
PORTB = 0
' turn of diodes on PORTB
delay_ms(1000)
' wait 1 second
goto eloop
' stay in a loop
end.
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
9
page
Commentaires sur ces manuels