Hey mister,
I almost understood what you did however there are some places I still don't really understand:
data @3,3,0,2,1 ' table to convert 'Sensor' variable result to according
' LED blink. See Result list bellow
=> I don't really understand this code? what is the meaning of value: 3,3,0,2,1 ? is this loop variable will get this value ?
' 4. Keep only GPIO<2:0> bits => what is the meaning of keep only GPIO<2:0> bits ? Does it mean that we just read the value of GPIO bits?
repeat
Generator = 1 ' enable sensor power
Sensor = GPIO ' read sensor
Generator = 0 ' disable sensor power => this is send low level right ?
Sensor = Sensor & 7 ' keep only Sensor bits => don't understand thisis this the comparison ? and what value will sensor get?
'
until Sensor != 7 ' redo the test untill one sensor is touch
'
' Now we will flash an LED to confirm wich sensor has been touch
' GPIO.0 => 1 Blink
' GPIO.1 => 2 Blink
' GPIO.2 => 3 Blink
'
read sensor,loop ' convert result to blink
repeat
LED = 1
PAUSE 200
lED = 0
PAUSE 200
loop = loop - 1
until loop = 0
=> if in this case I use 220v light bulb and I want it lights until we touch again what should I do ?
Bookmarks