I have acquired a Flow sensor, that reads "READADC 3,w3"
Grundfos Direct Sensors Web-link:
<A href='http://net.grundfos.com/doc/webnet/directsensors/images/pressurelow.pdf ' Target=_Blank>External Web Link</a>
And these values from the flow sensor I would like to output on my LCD-display
The lines below (like these "if w3 <= 26 then V050" I have to type 256 times,
There must be an easier way to do this? If you have a suggestion I would really like
a code example.
The codes for calculation of the values are made in a spread-sheet:
From steps to Flow-speed
= (A17*( 5/256)-0,5)*10/1,5
I thought of something like this myself, but not quite sure how to do it?
<code><pre><font size=2>
FOR-NEXT
For w3=1 to 256 STEP 1
(w3*(0.0195)-0,5)*10/1,5
Next w3
Grundfos Direct Sensors Web-link:
<A href='http://net.grundfos.com/doc/webnet/directsensors/images/pressurelow.pdf ' Target=_Blank>External Web Link</a>
And these values from the flow sensor I would like to output on my LCD-display
The lines below (like these "if w3 <= 26 then V050" I have to type 256 times,
There must be an easier way to do this? If you have a suggestion I would really like
a code example.
The codes for calculation of the values are made in a spread-sheet:
From steps to Flow-speed
= (A17*( 5/256)-0,5)*10/1,5
I thought of something like this myself, but not quite sure how to do it?
<code><pre><font size=2>
FOR-NEXT
For w3=1 to 256 STEP 1
(w3*(0.0195)-0,5)*10/1,5
Next w3
Code:
DisplayLine4:
READADC 3,w3
byte = $D4; Start Line 4
GOSUB SendCmdByte
EEPROM 56,("Flow: ") ;56..64
FOR get = 56 TO 64
READ get,byte
GOSUB SendDataByte
NEXT
if w3 <= 26 then V050
if w3 <= 27 then V052
if w3 <= 28 then V054
if w3 <= 29 then V056
if w3 <= 30 then V058
if w3 <= 31 then V060
if w3 <= 32 then V062
if w3 <= 33 then V064
if w3 <= 34 then V066
if w3 <= 35 then V068
V050:
let w3 = 000
goto Disp1000Linie4:
V052:
let w3 = 001
goto Disp1000Linie4:
V054:
let w3 = 003
goto Disp1000Linie4:
V056:
let w3 = 004
goto Disp1000Linie4:
V058:
let w3 = 005
goto Disp1000Linie4:
V060:
let w3 = 007
goto Disp1000Linie4:
V062:
let w3 = 008
goto Disp1000Linie4:
V064:
let w3 = 009
goto Disp1000Linie4:
V066:
let w3 = 011
goto Disp1000Linie4:
V068:
let w3 = 012
goto Disp1000Linie4:
Disp1000Linie4:
SERTXD("Flow: ",#w3," l/time"," ",CR,LF)
byte = w3 / 10000 | "0"
IF w3 >= 10000 THEN Disp1000Digit4
byte = " "
Disp1000Digit4:
GOSUB SendDataByte
Disp100Linie4:
byte = w3 / 1000 // 10 | "0"
IF w3 >= 1000 THEN Disp100Digit4
byte = " "
Disp100Digit4:
GOSUB SendDataByte
Disp10Linie4:
byte = w3 / 100 // 10 | "0"
IF w3 >= 100 THEN Disp10Digit4
byte = " "
Disp10Digit4:
GOSUB SendDataByte
DispUnits4:
byte = w3 / 10 // 10 | "0"
GOSUB SendDataByte
DispDecimalPoint4:
byte = "."
GOSUB SendDataByte
DispDecimal4:
byte = w3 // 10 | "0"
GOSUB SendDataByte
byte = " "
GOSUB SendDataByte
byte = "l"
GOSUB SendDataByte
byte = "/"
GOSUB SendDataByte
byte = "m"
GOSUB SendDataByte
'byte = "i"
'GOSUB SendDataByte
'byte = "n"
'GOSUB SendDataByte
goto DisplayLine1
<b>
Bestregards
Monie
</b>
Edited by - Monie on 2/8/2006 2:11:44 PM </font></pre></code>
Edited by - Monie on 2/8/2006 2:14:20 PM </font></pre></code>