Temperatur wird nun vom Hardware geholt
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SanShared;
|
using SanShared;
|
||||||
|
using Tinkerforge;
|
||||||
|
|
||||||
namespace TempCAN
|
namespace TempCAN
|
||||||
{
|
{
|
||||||
@@ -11,10 +12,25 @@ namespace TempCAN
|
|||||||
{
|
{
|
||||||
private static string HOST = "localhost";
|
private static string HOST = "localhost";
|
||||||
private static int PORT = 4223;
|
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()
|
public double GetTemperatur()
|
||||||
{
|
{
|
||||||
return 12.3;
|
return temperatur;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user