Sunday, November 29, 2009

Dresses For Twelve Year Olds

comparison

After doing some testing, I concluded that the best way to make a comparison between two LDR or at least that I have worked for me is this: Turn
and led off with 2 LDR: led var

PORTB.0, call the port led
ldr1 var Portb.1 B2, call the port B0
ldr1 ldr2 var Portb.2, call the port B1 ldr2

BYTE var b1 b0 var var BYTE BYTE b2

Home: POT
ldr1, 255, b0
ldr2 POT, 255, b1

if ledon Then b0 = b1; If = a b1 b0 is going to ledon
if b0> b1 Then off; If b0 b1 is greater than
go off if b1> b0 Then off; If b0 b1 is greater than go off

ledon: high
led, LED Light
goto start; Back to top

off:
b2 = b0 - b1; Compare b0 and b1 and gives value to
b2 b2 = b1 - b0, b1 and b0 Compare and gives value to
b2 if b2> Then ledoff 15; If the difference between b0 and b1 b2 ie is May 15 will goto ledon
ledoff

ledoff: low
led; Turn off the port B2 (LED off)
goto start; Back to top
end; End of program

Well I hope that people like me, a newcomer to microcontrollers that will be useful!

0 comments:

Post a Comment