If avIndex = 2 Then
If ethClient.Connected Then
Dim tempData As Float = 0
For i = 0 To 2
tempData = tempData + averageData(i)
Next
tempAverage = tempData / 3
Log("SendTopic tempAvergae: ", tempAverage)
Dim s As String = NumberFormat(tempAverage, 0, 1)
Log("Average = ", s)
mqtt.Publish("Termoelement", s.GetBytes)
Log("Average Temperature published: ", s.GetBytes)
avIndex = 0
Else
Log("Error: Ethernet not connected")
End If
End If
avIndex = avIndex + 1
/[CODE]