You are on page 1of 2

$regfile = "m8def.

dat"
$crystal = 8000000
$baud = 9600

config PORTD = output


config PORTC = output
config portb = input
config ADC = Single, Prescaler = Auto, Reference = Internal
config lcdpin = pin, db4 = portd.4 , db5 = portd.5 , db6 = portd.6 , db7 = portd.7 ,
E = portd.3 , Rs = portd.2
config lcd = 16 * 2
cursor off Noblink

dim x as Bit
dim y as Word

locate 1,1
lcd "SAKLAR 1"
locate 2,1
lcd "SAKLAR 2"

Do
x = PINB.0

locate 1,10
if x = 0 then
lcd "OFF"
PORTC.0 = 0
else
lcd "ON "
PORTC.0 = 1
end if

x = PINB.1
locate 2, 10
if x = 0 then
lcd "OFF"
PORTC.1=0
else
lcd "ON "
PORTC.1 = 1
end if
y = Getadc(0)
waitms 200

Loop

You might also like