my project is a light that automatically turns on as light levels drop and has a specific program for if full beam is needed for a breif period,
this is all working fine on simulation, but once i program it into the pic the ouputs from the pic are completely different to that on the simulation
the program goes like this:
any criticism's appreciated
Regards
Symon20
this is all working fine on simulation, but once i program it into the pic the ouputs from the pic are completely different to that on the simulation
the program goes like this:
Code:
main:
prog:
if pinc.2 = 1 then push 'if pinC.2 gets a pulse high then go to the program Push
readadc c.1, b3 'convert analouge signal from C.1 and send as digital signal to B.3
goto main
push:
high b1 'take pin b1 high
b1=255 'let b1 = $255
wait 1 'wait for one second
for b1=255 to 0 step - 2 'step down two $ levels each time round
pwmout B.3,255,b1
readadc c.1, b2 'check the input at b2
if b2=b1 then goto main 'if b2 = b1 then go back to the start of the program
pause 10 'stop for 10 milliseconds
next 'go back to the line pwmout B.3,255,b1
goto main
Regards
Symon20