Temperatur wird nun vom Hardware geholt

This commit is contained in:
Husky
2018-07-01 16:45:46 +02:00
parent 78ccc768df
commit e45ae7447d

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SanShared;
using Tinkerforge;
namespace TempCAN
{
@@ -11,10 +12,25 @@ namespace TempCAN
{
private static string HOST = "localhost";
private static int PORT = 4223;
private static string UID = "dW3";
double temperatur;
public TinkerForgeTemperatur()
{
IPConnection ipcon = new IPConnection();
BrickletTemperature t = new BrickletTemperature(UID, ipcon);
ipcon.Connect(HOST, PORT);
short temp = t.GetTemperature();
temperatur = (temp / 100.0);
ipcon.Disconnect();
t = null;
ipcon = null;
}
public double GetTemperatur()
{
return 12.3;
return temperatur;
}
}
}