Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
PrintTemperature("Tensão de entrada: ", 1.2)
PrintTemperature("Tensão de entrada: ", -1.2)
PrintTemperature("Tensão de entrada: ", -1)
PrintTemperature("Tensão de entrada: ", 0)
End Sub
Private Sub PrintTemperature (prefix() As Byte, temp As Float)
Dim s() As Byte = NumberFormat(temp, 1, 2)
Dim bc As ByteConverter
Dim i As Int = bc.IndexOf(s, ".")
If i > -1 Then
Log(prefix, bc.SubString2(s, 0, i), ",", bc.SubString(s, i + 1))
Else
Log(prefix, s)
End If
End Sub