diff --git a/Assets/.DS_Store b/Assets/.DS_Store index 7d5b280..9b88503 100644 Binary files a/Assets/.DS_Store and b/Assets/.DS_Store differ diff --git a/Assets/1OurScripts/ConnectUnityWithSensors.cs b/Assets/1OurScripts/ConnectUnityWithSensors.cs index 2de6a0a..a16d6fa 100644 --- a/Assets/1OurScripts/ConnectUnityWithSensors.cs +++ b/Assets/1OurScripts/ConnectUnityWithSensors.cs @@ -64,7 +64,7 @@ public class ConnectUnityWithSensors : MonoBehaviour if (forceDataReceived) { - if (receivedForceValue > 40) + if (receivedForceValue > 900) { Debug.Log("Force threshold exceeded, action triggered."); isForceDetected = true; diff --git a/Assets/OurESP32Scripts/ESP32/ESP32.ino b/Assets/OurESP32Scripts/ESP32/ESP32.ino index 0fc6615..64f5500 100644 --- a/Assets/OurESP32Scripts/ESP32/ESP32.ino +++ b/Assets/OurESP32Scripts/ESP32/ESP32.ino @@ -9,13 +9,13 @@ using namespace websockets; WebsocketsServer server; WebsocketsClient client; int forceSensorValue = 0; -const int forceSensorPin = 34; // Change to your actual force sensor pin +// const int forceSensorPin = 34; // Change to your actual force sensor pin void setup() { Serial.begin(115200); // Initialize force sensor pin as input - pinMode(forceSensorPin, INPUT); + // pinMode(forceSensorPin, INPUT); // Connect to WiFi WiFi.begin(ssid, password); @@ -62,13 +62,13 @@ if (server.poll()) { //server.poll() checks if any client is waiting to connect if (msg.data().equalsIgnoreCase("Need Force")) { digitalWrite(11, HIGH); //Notify user to use force sensor Serial.println("Reading value from Force Sensor..."); - while (forceSensorValue <= 20) { + while (forceSensorValue <= 40) { analogReadResolution(10); // This statement tells in how many bits the AnalogRead should happen. // analogRead function returns the integer 10 bit integer (0 to 1023) forceSensorValue = analogRead(A0); - if (forceSensorValue > 20) { + if (forceSensorValue > 40) { digitalWrite(13, HIGH); Serial.print(forceSensorValue, DEC); Serial.print("\n"); // Sending New Line character is important to read data in unity @@ -88,5 +88,4 @@ if (server.poll()) { //server.poll() checks if any client is waiting to connect // close the connection client.close(); } -} - +} \ No newline at end of file diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index b47cb9d..4bec30e 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -19186,6 +19186,7 @@ MonoBehaviour: m_EditorClassIdentifier: narrationHasFinished: 0 seedHasAppeared: 0 + narrationHasStarted: 0 audioSource: {fileID: 171465764} narrationClip: {fileID: 8300000, guid: 09a27277c062f490ea6f7f06842f100f, type: 3} narrationClipTwo: {fileID: 8300000, guid: 33724cce213214c3e8bba7e1c8b7f9de, type: 3}