mikediv
03-31-2009, 12:10 AM
Hi guys here is a very simple spin program
CON
··· _clkmode = xtal1 + pll16x
··· _xinfreq = 5_000_000
Con Pin=4···· 'set pin to equal 4
Pub myledandinput
·· dira[pin]:=1····· ' set pin 4 to output
·· !outa[pin]
·· Dira[21]:= 0················ ' make pin 21 an input
·· If Then ?????????????????????
·· ina[21]
·· outa[6] := ina[21]··················· ' Copy P21 input to P6 ouput
I need to use a command like If-Then I can not find anything in the manual ,,that I understand anyway" on how to do this.
I want to read an input pin and "IF" its in a certain conditon jump to another part of the program so something like If pin 4 equals 1 then goto Con or Pub??
As always thanks in advance
·
CON
··· _clkmode = xtal1 + pll16x
··· _xinfreq = 5_000_000
Con Pin=4···· 'set pin to equal 4
Pub myledandinput
·· dira[pin]:=1····· ' set pin 4 to output
·· !outa[pin]
·· Dira[21]:= 0················ ' make pin 21 an input
·· If Then ?????????????????????
·· ina[21]
·· outa[6] := ina[21]··················· ' Copy P21 input to P6 ouput
I need to use a command like If-Then I can not find anything in the manual ,,that I understand anyway" on how to do this.
I want to read an input pin and "IF" its in a certain conditon jump to another part of the program so something like If pin 4 equals 1 then goto Con or Pub??
As always thanks in advance
·