mirror of
https://github.com/Mukheem/TwinTurbine.git
synced 2025-05-05 16:10:35 +02:00
Voltage fixed
This commit is contained in:
parent
2ae4339044
commit
6e69ee6505
Assets/SharedSpatialAnchors/Scripts
@ -37,6 +37,7 @@ public class ApiResponse
|
|||||||
|
|
||||||
public class API : MonoBehaviour
|
public class API : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public TextMeshProUGUI voltageValue;
|
||||||
public TextMeshProUGUI windDirValue;
|
public TextMeshProUGUI windDirValue;
|
||||||
public TextMeshProUGUI temperatureValue;
|
public TextMeshProUGUI temperatureValue;
|
||||||
public TextMeshProUGUI loc;
|
public TextMeshProUGUI loc;
|
||||||
@ -105,6 +106,7 @@ public void ExtractDataFromJson(string json)
|
|||||||
for (int i = 0; i < dataPoints.Count; i++)
|
for (int i = 0; i < dataPoints.Count; i++)
|
||||||
{
|
{
|
||||||
DataPoint point = dataPoints[i];
|
DataPoint point = dataPoints[i];
|
||||||
|
voltageValue.text = webSocketControllerScript.voltageValue.ToString();
|
||||||
loc.SetText("Kista(Lat:59.4067 Long:17.9452)");
|
loc.SetText("Kista(Lat:59.4067 Long:17.9452)");
|
||||||
if (point.name == "wd")
|
if (point.name == "wd")
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ public class WebSocketController : MonoBehaviour
|
|||||||
|
|
||||||
// Serial Port to which Arduino is connected
|
// Serial Port to which Arduino is connected
|
||||||
SerialPort arduinoPort = new SerialPort("COM4", 115200);
|
SerialPort arduinoPort = new SerialPort("COM4", 115200);
|
||||||
|
public float voltageValue = 0.0f;
|
||||||
|
|
||||||
public void Start(){
|
public void Start(){
|
||||||
ConnectWithESP32();
|
ConnectWithESP32();
|
||||||
@ -42,8 +42,11 @@ public class WebSocketController : MonoBehaviour
|
|||||||
};
|
};
|
||||||
ws.OnMessage += (sender, e) =>
|
ws.OnMessage += (sender, e) =>
|
||||||
{
|
{
|
||||||
// Debug.Log("Received message: " + e.Data);
|
Debug.Log("Received message: " + e.Data);
|
||||||
if(e.Data.Equals("Start Narration", StringComparison.OrdinalIgnoreCase)){
|
voltageValue = float.Parse(e.Data.Split(':')[1]);
|
||||||
|
//Voltage:180.0
|
||||||
|
Debug.Log(e.Data.Split(':')[1]);
|
||||||
|
if (e.Data.Equals("Start Narration", StringComparison.OrdinalIgnoreCase)){
|
||||||
// narrationControllerScript.startNarration = true;
|
// narrationControllerScript.startNarration = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user