|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Voltage Byte -> True Voltage
I remember seeing the formula for this somewhere. Please Help. I'm writing a custom dashboard in VB which takes data direct from the dashboard port from the OI. How do I convert the voltage byte into true voltage?
|
|
#2
|
|||
|
|||
|
Look in the default program listing, just after the c_variable CON 1 listings.
In Initialization Constant VOLTAGE - USER DEFINED, the number to initialize the voltage constant is equal to INT((DESIRED .. VOLTAGE + 0.4) * 16.3) For your purpose, you'll have to reverse the process. |
|
#3
|
|||||
|
|||||
|
Unless they removed it when they updated their site, the formula to extract a battery voltage from the 0-254 value was in the FAQ at Innovation FIRST's site.
|
|
#4
|
|||
|
|||
|
What's worse, fractional people trying to use metric or base 10 people trying to use base 2?
|
|
#5
|
|||
|
|||
|
I tried the formula in the default code. It doesn't seem to work.
|
|
#6
|
|||
|
|||
|
Ok, I got it. It was on First's web site, FAQ section. I knew I saw it somewhere. There is a difference between the default code and First's web site. If you reverse the default code, as stated above, you get a term of -0.4, while if you look at First FAQ, you get a term of 0.4. And I was off by approximately 0.8 so I see that was my problem.
|
|
#7
|
|||||
|
|||||
|
A bit off topic, I'm trying to get my dashboard monitor working , but I haven't programmed in VB for a long time. How do I round the battery voltage to one decimal place?
|
|
#8
|
|||||
|
|||||
|
Low Bat LED
Quick question: Do you need sensor8 to be active in your program for the Low Bat LED function to work, or do you only need sensor8 if you are using the analog voltage somewhere in your program?
Only reason I wonder is that our low bat LED comes on after about 5 mins and we are not sure if this is because of the much higher drain on the batter this year vs last year. |
|
#9
|
|||||
|
|||||
|
Quote:
varVolt=(int(varVolt*10+0.5)/10) Or, if you're just outputting it, do this: lblVoltage.caption = Format$(varVolt,"##.0") |
|
#10
|
|||
|
|||
|
I found the following formula in the FAQ on the Innovation First website:
Voltage = ((((binary_value*79)/128)+4)/10 Hope this helps. |
|
#11
|
||||||
|
||||||
|
Quote:
It is my understanding that your program can set the voltage that the LED flashes Below is from the Default Code from Innovation First: Quote:
I hope this helps. Joe J. |
|
#12
|
|||||
|
|||||
|
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FIRST-SME membership | archiver | 2001 | 5 | 24-06-2002 00:41 |