Results 1 to 3 of 3

Thread: Offset for phidgets / temperature sensor

  1. #1
    Maximum Bitrate skippy76's Avatar
    Join Date
    Mar 2004
    Location
    Cambridge, MA, USA
    Posts
    507

    Offset for phidgets / temperature sensor

    Hi,

    Due to a little inaccuracy in the phidget temperature sensor, I need to apply an offset to the sensor value.

    Guino: Please could you add the following code to Road runner:

    - modRoadRunner: New version of set PhidGet func

    'Set PhidGet Temperature Sensor Info
    Public Function GetPhid(CODE As String, Fmt As String) As String
    Dim S As String
    Dim N As Double

    On Error Resume Next

    'If can't find it, return N/A
    If PH Is Nothing Then GetPhid = "N/A": Exit Function

    'Get Sensor Value
    N = PH.SensorValue(Val(Mid(CODE, 5)) - 1)

    'apply offset (added by skippy76)
    N = N + PHOffset(Val(Mid(CODE, 5)))

    'Get Tip Data
    S = Fmt
    S = Mid(S, 2, Len(S) - 2)

    'See if need to apply conversion
    Select Case LCase(S)
    Case "c2f"
    'Show in C
    N = N - 200: N = N / 4
    N = (N * 9) / 5: N = N + 32
    GetPhid = Format(N, "0.0F")
    Case "f2c"
    'Show in F
    N = N - 200: N = N / 4
    GetPhid = Format(N, "0.0C")
    Case "volt"
    'Show in V
    N = N - 500: N = N * 0.06
    GetPhid = Format(N, "0.00")
    Case "50amp"
    'Show in Amps
    N = N - 500: N = N * 0.1
    GetPhid = Format(N, "0.00")
    Case "15amp"
    'Show in Amps
    N = N - 500: N = N * 0.03
    GetPhid = Format(N, "0.00")
    Case "gp"
    'Show in Pressure
    N = (N / 4) + 10
    GetPhid = Format(N, "0.00")
    Case Else
    'Return Sensor Info
    GetPhid = Format(N, S)
    End Select

    End Function



    - Add this to the select in LoadSettings of rmLoader

    ' Phidget offset
    Case "phidget1"
    PHoffset(1) = DT(1)
    Case "phidget2"
    PHoffset(2) = DT(2)
    Case "phidget3"
    PHoffset(3) = DT(3)
    Case "phidget4"
    PHoffset(4) = DT(4)
    Case "phidget5"
    PHoffset(5) = DT(5)
    Case "phidget6"
    PHoffset(6) = DT(6)
    Case "phidget7"
    PHoffset(7) = DT(7)
    Case "phidget8"
    PHoffset(8) = DT(8)

    - Add this line to the decs in the modRoadRunner module

    Public PHoffset(6) As Long 'Phidget offsets
    06 Volvo XC90
    Use to have installed MII 10000/512Mb/40GB, Lilliput 7", OPUS 90W, Wifi-G PCMCIA, Head Unit Aux adapter, Delorme GPS, XM PCR, Audigy NX, RR
    Car PC downloads: http://carpc.harteveldt.com/

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,762
    Done... also, I changed the DT(x) values on loadsettings (all of them) to = Val(DT(1)) ... you had them going up to dt(8)...
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    Maximum Bitrate skippy76's Avatar
    Join Date
    Mar 2004
    Location
    Cambridge, MA, USA
    Posts
    507
    Excellent, thanks!

    Well spotted on the DT(x)... I was a bit over zelest on the copy / paste changes I guess!

    Your the man! (wht the woman still I hope!)

    Andrew
    06 Volvo XC90
    Use to have installed MII 10000/512Mb/40GB, Lilliput 7", OPUS 90W, Wifi-G PCMCIA, Head Unit Aux adapter, Delorme GPS, XM PCR, Audigy NX, RR
    Car PC downloads: http://carpc.harteveldt.com/

Similar Threads

  1. Relocating Portable DVD Remote Sensor...
    By AEFL92 in forum General Hardware Discussion
    Replies: 1
    Last Post: 09-10-2007, 04:03 PM
  2. Ideal location for a temperature sensor??
    By carpcnoobie in forum General Hardware Discussion
    Replies: 12
    Last Post: 10-07-2005, 01:07 AM
  3. Phidget Temperature sensor calibration
    By skippy76 in forum Road Runner
    Replies: 1
    Last Post: 10-05-2005, 11:47 PM
  4. Real temperature solution - what do you think?
    By dmurray14 in forum Centrafuse
    Replies: 10
    Last Post: 01-24-2005, 10:38 AM
  5. MPJA - MECI ASTEC DC-DC Converter
    By Luc in forum General Hardware Discussion
    Replies: 39
    Last Post: 11-22-2004, 10:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •