Author Topic: My temperature logging project  (Read 918 times)

ajohnson

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: My temperature logging project
« on: December 13, 2016, 07:54:25 pm »
well, with the following code currently running

Code: [Select]
Class BeaconTemp
    Shared Event Boot()
        Lplan.SetLowPowerMode(120)
        Lplan.SetBeaconTime(30)
    End Event
   
    Shared Event GetTemp() RaiseEvent Every 15 Minutes
        Dim mcVoltage As Short = Device.BatteryVoltage
        Dim voltS As String = mcVoltage.ToString
        Dim tempC As Float = TempSensor.GetTemp
        Dim tempF As Float = TempSensor.ToFarenheit(tempC) * 10
        Dim TempFSh As Short = tempF.ToShort()
        Dim beaconData As ListOfByte = New ListOfByte()
        beaconData.AddShort(TempFSh)
        beaconData.AddShort(mcVoltage)
        LedGreen = True       
        Lplan.SetBeaconData(beaconData)
        Thread.Sleep(50000)
        LedGreen = False
    End Event
End Class
I seem to hit around 21 days on my Energizer CR2032s.  Am I doing something wrong?