PUSH BUTTON / SWITCH INTERFACING WITH DSPIC30F2010 USING MIKRO C

Photo of author

By Jackson Taylor


program BLINK
dim LEDRED as sbit at LATE1_bit
dim switch1 as sbit at RD1_bit
main:
TRISD.1 = 1
TRISE.1=0
while TRUE
if (switch1 and 1)=0 then       ‘pull up required in this pin
LEDRED=1
else
LEDRED=0
end if
wend
end.

See also
ARDUINO AND SERVO MOTOR INTERFACING SIMULATION IN PROTEUS