Try this
Code:
TRISB = %10000001 ' Set PORTB (0)INPUT (1-5)OUTPUTS
CMCON = 7
SecSwitch VAR PORTA.5
Red VAR PORTB.1
Bright VAR Byte
storedloop VAR Byte
bright = 1
main:
pwm red, bright, 5
If secswitch = 0 then
If bright < 255 then bright = bright + 1
If bright = 255 then gosub flash
endif
Goto main
Flash:
For storedloop = 1 to 3
High red
Pause 100
Low red
Pause 100
Next storedloop
Return
As i'm using the MCLR as an input for the switch, is there a way to set this fuse in PBP, i'm using MeLabs Serial Programmer. I have to set it manually each time, which is a pain.
It depends on your PIC type and the assembler you are using (PM, or MPASM)
see: Presetting Configuration Fuses
Last edited by NavMicroSystems; - 8th April 2005 at 16:27.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks