Hello Zmet,
Z>>LED var Byte 'LED variable setup as a byte. Can some one explain this to me i'm not sure what its there for or what it does? I know this is a dumb question but I need to know. after two weeks of reading the manual I just dont seem to be getting it.<<
Steve did a great job of explaining.
LED var Byte.
Do not confuse the Initials for a Light Emittiing Diode (LED) with the LED used here.
it could also read :
counter Var Byte
Recieve Var Byte
Transmit Var Byte
Or (as your example
LED var Byte.
The person who "chose" the letters LED for his variable, probably wanted something very simple to use, so that he will be able to read his program better.
LED var byte 'This variable (LED) will count the number of times this Porta.0 is high.
LED2 var byte 'this variable will count the number of times the Porta.1 is high.
LED=0;
LED2=0;
Loop:
if Porta.0=1 LED=LED+1 0 'is it on? add another to counter
if Porta.1=1 LED2=LED2+1 'is it on? add another to counter
if LED>10 then finish program
....
....
goto loop:
Finish program:
LCDout "Number of times first LED was on is", LED,"TIMES"
LCDout "Number of times second LED was on is",LED2,"Times"
end
This is PSUEDO code. but gives you a example of what a person can do.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks