DrWhoF said:I need to design and build telemetry system to control a device 700m apart.
At both ends I need 4 digital inputs, 4 digital outputs, 1 analog input (0-5V) and 1 analog output (0-5V).
In addition I need to read rotary encoder with 2 signals shifted by 90°, convert it to distance and send through telemetry to the other end.
Any ideas are welcome.
DrWhoF said:This rotary encoder will be coupled with shaft of a valve.
setfreq m4 ; Freq 4/8MHz & 4800/9600bps
symbol CounterL = 0 ' memory location 0
symbol CounterH = 1 ' memory location 1
'write CounterL, 0
'write CounterH, 0
read CounterL, b2
read CounterH, b3
setint %01000000,%01000000 ‘ activate interrupt when pin6 goes high
loop:
pause 2000 ‘ wait 2 seconds
goto loop ‘ loop back to start
interrupt:
if pin6 = 1 then interrupt ‘ loop here until the interrupt cleared
if pin7 = 0 then increase
let w1 = w1 - 1
goto exit
increase:
let w1 = w1 + 1 ' w1 = b3(H) b2(L)
exit:
write CounterL, b2
write CounterH, b3
sertxd("<", #w1) ' send counter w1 via SerPort
setint %01000000,%01000000 ‘ re-activate interrupt
return ‘ return from sub
wait 5 ' wait 5s after power on ..
for w1 = 0 to 999
pulsout 2,1000 ' send a 10 ms pulse out of pin OUT 2
pause 10 ' pause 10 ms
next w1 ' loop back to start
stop
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?