ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#21895 - 06/21/10 04:06 PM Bobcat Light data into percentage value
1021 Offline
junior
*

Registered: 09/12/06
Posts: 32
Loc: Mississauga, Ontario, Canada
Hello

I'm trying to capture my Bobcat L data into variable and than I'm hopping to convert it into a percentage value

For example if bobcat numeric value = 100/darkness than I need the variable to display 0%
if bobcat value = 356/max brightness than the variable = 100%

is it possible?

Thanks for any help or directions

1021

Top
#21897 - 06/21/10 08:22 PM Re: Bobcat Light data into percentage value [Re: 1021]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6401
Loc: Montreal, QC, Canada
Yes you can do that.

Get the data value captured into a variable, scale it (subtract 100), multiply it by 100, and divide it by 256.

Like this:

IF Module #1 BOBCAT-L is < 999 //"If Compare Bobcat Data" instruction
THEN Load Data to Variable #1 //capture it
THEN Variable #1 - 100
THEN Variable #1 * 100
THEN Variable #1 / 256
THEN Variable #2 = Variable #1 //save as final value
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21900 - 06/22/10 03:45 AM Re: Bobcat Light data into percentage value [Re: Guy Lavoie]
1021 Offline
junior
*

Registered: 09/12/06
Posts: 32
Loc: Mississauga, Ontario, Canada
Thank you
I will try it this aft but it makes prefect sens
now I have to find the way to display the converted data
into Leopard screen
1021

Top
#21901 - 06/22/10 05:00 AM Re: Bobcat Light data into percentage value [Re: 1021]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6401
Loc: Montreal, QC, Canada
Just display it as a formatted variable, like "Temp: %d". Look at the application notes in the downloadable Leopard manual to see how to use formatted variables.
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21902 - 06/22/10 06:40 AM Re: Bobcat Light data into percentage value [Re: Guy Lavoie]
1021 Offline
junior
*

Registered: 09/12/06
Posts: 32
Loc: Mississauga, Ontario, Canada
Yes Thanks I have to take a look at this
I'm going to use my "templates" of my temp and humidity sensors to display this data
1021

Top
#21904 - 06/22/10 07:54 PM Re: Bobcat Light data into percentage value [Re: Guy Lavoie]
1021 Offline
junior
*

Registered: 09/12/06
Posts: 32
Loc: Mississauga, Ontario, Canada
It works like a charm, no problems
Thanks for your help
1021

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 26 anonymous users online.
Recent Posts
how to post an icon
by manu
02/03/12 03:40 AM
Command Pair
by kuro
02/01/12 12:49 AM
Does anyone have a copy of the latest TSE?
by sevenzenith1
01/30/12 05:17 AM
Have HAL2000 do the work or the Ocelot?
by khem
01/28/12 02:49 PM
Ocelot + Powermid = Fail
by Guy Lavoie
01/27/12 03:37 PM
Shout Box

Newest Members
dfgg, manu, kuro, sevenzenith1, chuck214
2748 Registered Users
Forum Stats
2747 Members
19 Forums
3835 Topics
22711 Posts

Max Online: 67 @ 08/16/11 03:08 PM
February
Su M Tu W Th F Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29