issue when use thermometer and adreesH & addresL

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Pascal13
Posts: 3
Joined: Wed Aug 15, 2007 6:15 pm

issue when use thermometer and adreesH & addresL

Post by Pascal13 »

Hi ,
I m a french so sorry for my mistakes in english.

I use Flowcode V2( upgrade from V1)
and i have an issue with AddressH & Address L when i use thermoter.
Both addressH & addressL are incremented simultaneously so i can't undersdand how i use 10 bits register.
for exemple

for very low input in ADC0 , i have for addressH "009" abd addressL "192".
Thanks for your help

Best regards
Pascal

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello

Because Flowcode V2 does not have 16 bit variables it is easier to just an 8 bit variable.

The High byte of the returned value contains the 8 most significant bits and the low byte contains the 2 least significant bits.

You can simply use the high byte on its own without loosing much precision.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

Flowcode forces the ADC result to be "left-shifted". This means that the most significant 8-bits of the 10-bit value are "addressH". The remaining 2-bits are in "addressL", but these occupy the 2 most-significant bits (so addressL can take the values 0x00, 0x40, 0x80 or 0xC0 - i.e. 0, 64, 128 or 192).

Flowcode v3 allows signed 16-bit numbers and has an improved ADC component that can return a result as 8-bits or 10-bits. This should make things easier. It also has many other improvements over v2.

You can install a free/demo version of v3 without affecting your existing v2 installation so you can see for yourself:
http://www.matrixmultimedia.com/Flowcode3a-X.php

And your English is very good - certainly better than my French!

Pascal13
Posts: 3
Joined: Wed Aug 15, 2007 6:15 pm

Post by Pascal13 »

Hi ,
Thanks for your fast answer Steve and Benj.
I all understand :wink: .

If i upgrade flowcode V2 to V3, does my program V2 run on V3.
When i upgraded V1 to V2 i have to rewritte all my prog.

Best regards
Pascal

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

Hello Pascal,

V2 programs usually upgrade ok when opened in V3. The major problem occurs when you have your own C code enbedded within the flowchart.

But we will help to sort out any upgrade problems you have.

Also, you can have V2 and V3 running on your PC at the same time. So if you find they don't work in V3, you can open them instead in V2.

Pascal13
Posts: 3
Joined: Wed Aug 15, 2007 6:15 pm

Post by Pascal13 »

thanks for all, i think to upgrade to V3

best regard

Pascal

Post Reply