Using C#, I have 5 strings that are reading data from a temperature sensor on an Arduino board:
string currentTemp1 = serialPort1.ReadLine();
Thread.Sleep(1000);
string currentTemp2 = serialPort1.ReadLine();
Thread.Sleep(1000);..... and so on.
This is returning the values into the strings such as: 19.45, 19.45, 19.50, 19.45, 19.50.
I've tried a bit of research into trying to get the average, but am having problems working out how to convert the strings with the 2 decimal places into an Integer, and then getting the average.
Can someone please point me in the right direction.