w_2_Lab_code from Michael's Phycom syllabus
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 2/21/2006 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4 'Define the clock speed
'set the jobs of the different pins
output portd.1
output portd.0
input portd.2
broc:
if portd.2 = 1 then 'if the switch is pushed
low portd.1 'turn on one LED
high portd.0 'and off the other
else 'if the switch is not pushed
high portd.1
low portd.0
endif
goto broc 'go back to the beginning and do it again
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 2/21/2006 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
DEFINE OSC 4 'Define the clock speed
'set the jobs of the different pins
output portd.1
output portd.0
input portd.2
broc:
if portd.2 = 1 then 'if the switch is pushed
low portd.1 'turn on one LED
high portd.0 'and off the other
else 'if the switch is not pushed
high portd.1
low portd.0
endif
goto broc 'go back to the beginning and do it again


0 Comments:
Post a Comment
<< Home