26 lines
464 B
Plaintext
26 lines
464 B
Plaintext
' ########### start ###########
|
|
' pic:PIC18F422
|
|
' ########### end ###########
|
|
|
|
'A program to flash LED on PORTB.3
|
|
|
|
'Chip model
|
|
#chip 18f442, 25
|
|
#config OSC = HS, WDT = OFF, PWRTE = ON', CP = OFF
|
|
#define led PORTB.3
|
|
|
|
Startup:
|
|
count = ReadAD(AN0)
|
|
'Main routine
|
|
Loop:
|
|
'Turn one LED on, the other off
|
|
SET led ON
|
|
wait 1 sec
|
|
'Now toggle the LEDs
|
|
|
|
SET led OFF
|
|
wait 1 sec
|
|
'Jump back to the start of the program
|
|
goto Loop
|
|
|