diff --git a/.DS_Store b/.DS_Store index 719fe77..b4a49e1 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Assets/.DS_Store b/Assets/.DS_Store index 6f1125c..0a25e58 100644 Binary files a/Assets/.DS_Store and b/Assets/.DS_Store differ diff --git a/Assets/1OurESP32Scripts/.DS_Store b/Assets/1OurESP32Scripts/.DS_Store index 7a8b3b1..fe60681 100644 Binary files a/Assets/1OurESP32Scripts/.DS_Store and b/Assets/1OurESP32Scripts/.DS_Store differ diff --git a/Assets/1OurESP32Scripts/TouchServo/TouchServo.ino b/Assets/1OurESP32Scripts/TouchServo/TouchServo.ino index 14db969..594df0f 100644 --- a/Assets/1OurESP32Scripts/TouchServo/TouchServo.ino +++ b/Assets/1OurESP32Scripts/TouchServo/TouchServo.ino @@ -15,6 +15,7 @@ WebsocketsClient client; bool touchDetected = false; // Flag to track touch detection bool touchHandled = false; // Flag to track if touch has been handled +bool messageHasBeenSent = false; int touchValue; @@ -52,21 +53,21 @@ void loop() { if (msg.data().equalsIgnoreCase("Need Touch")) { Serial.println("Reading value from touch sensor!"); //touchValue = touchRead(4); - Serial.println(touchRead(4)); + //Serial.println(touchRead(4)); - while (touchRead(4) < 14000) { - if (touchRead(4) >= 14000) { + while (touchRead(4) < 40000) { + if (touchRead(4) >= 40000) { Serial.println("Value above threshold"); rotateServo(); - client.send(String(touchRead(4))); + client.send(String(40000)); break; } } } - + delay(500); } client.close(); } @@ -76,8 +77,14 @@ void loop() { void rotateServo() { // Rotate the servo motor 180 degrees - for (int posDegrees = 0; posDegrees <= 180; posDegrees++) { - servo1.write(posDegrees); - delay(10); // Adjust the delay for smooth rotation - } + + for (int posDegrees = 0; posDegrees <= 180; posDegrees++) { + servo1.write(posDegrees); + delay(10); // Adjust the delay for smooth rotation + } + + for(int posDegrees = 180; posDegrees >= 0; posDegrees--) { + servo1.write(posDegrees); + delay(10); + } } \ No newline at end of file diff --git a/Assets/Lowpoly Flowers/.DS_Store b/Assets/Lowpoly Flowers/.DS_Store new file mode 100644 index 0000000..759b2fd Binary files /dev/null and b/Assets/Lowpoly Flowers/.DS_Store differ diff --git a/Assets/Lowpoly Flowers/Materials/blinn1.mat b/Assets/Lowpoly Flowers/Materials/blinn1.mat index fece2df..3f5bfc8 100644 --- a/Assets/Lowpoly Flowers/Materials/blinn1.mat +++ b/Assets/Lowpoly Flowers/Materials/blinn1.mat @@ -117,7 +117,7 @@ Material: - _ZWrite: 1 m_Colors: - _BaseColor: {r: 0.6343293, g: 0.39881203, b: 0.716, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.6343293, g: 0.398812, b: 0.716, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Lowpoly Flowers/Materials/blinn2.mat b/Assets/Lowpoly Flowers/Materials/blinn2.mat index 4fb001e..6d9d182 100644 --- a/Assets/Lowpoly Flowers/Materials/blinn2.mat +++ b/Assets/Lowpoly Flowers/Materials/blinn2.mat @@ -117,7 +117,7 @@ Material: - _ZWrite: 1 m_Colors: - _BaseColor: {r: 0.77464443, g: 0.78431374, b: 0.55363315, a: 1} - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.77464443, g: 0.78431374, b: 0.55363315, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/OurESP32Scripts/.DS_Store b/Assets/OurESP32Scripts/.DS_Store new file mode 100644 index 0000000..236416c Binary files /dev/null and b/Assets/OurESP32Scripts/.DS_Store differ diff --git a/Assets/OurESP32Scripts/TouchServo.meta b/Assets/OurESP32Scripts/TouchServo.meta new file mode 100644 index 0000000..fafbb8f --- /dev/null +++ b/Assets/OurESP32Scripts/TouchServo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 391343d09cc454bf881e4464a3eeea0b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OurESP32Scripts/TouchServo/TouchServo.ino b/Assets/OurESP32Scripts/TouchServo/TouchServo.ino index 14db969..594df0f 100644 --- a/Assets/OurESP32Scripts/TouchServo/TouchServo.ino +++ b/Assets/OurESP32Scripts/TouchServo/TouchServo.ino @@ -15,6 +15,7 @@ WebsocketsClient client; bool touchDetected = false; // Flag to track touch detection bool touchHandled = false; // Flag to track if touch has been handled +bool messageHasBeenSent = false; int touchValue; @@ -52,21 +53,21 @@ void loop() { if (msg.data().equalsIgnoreCase("Need Touch")) { Serial.println("Reading value from touch sensor!"); //touchValue = touchRead(4); - Serial.println(touchRead(4)); + //Serial.println(touchRead(4)); - while (touchRead(4) < 14000) { - if (touchRead(4) >= 14000) { + while (touchRead(4) < 40000) { + if (touchRead(4) >= 40000) { Serial.println("Value above threshold"); rotateServo(); - client.send(String(touchRead(4))); + client.send(String(40000)); break; } } } - + delay(500); } client.close(); } @@ -76,8 +77,14 @@ void loop() { void rotateServo() { // Rotate the servo motor 180 degrees - for (int posDegrees = 0; posDegrees <= 180; posDegrees++) { - servo1.write(posDegrees); - delay(10); // Adjust the delay for smooth rotation - } + + for (int posDegrees = 0; posDegrees <= 180; posDegrees++) { + servo1.write(posDegrees); + delay(10); // Adjust the delay for smooth rotation + } + + for(int posDegrees = 180; posDegrees >= 0; posDegrees--) { + servo1.write(posDegrees); + delay(10); + } } \ No newline at end of file diff --git a/Assets/OurESP32Scripts/TouchServo/TouchServo.ino.meta b/Assets/OurESP32Scripts/TouchServo/TouchServo.ino.meta index 2d206ab..51aea02 100644 --- a/Assets/OurESP32Scripts/TouchServo/TouchServo.ino.meta +++ b/Assets/OurESP32Scripts/TouchServo/TouchServo.ino.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4ea5e337c5c484077bd7704cb81b5270 +guid: 310824fe30798457f9bad04704b994bc DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index ed29de0..7deaff0 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -4599,7 +4599,7 @@ Transform: m_GameObject: {fileID: 297646202} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 6.388697, y: -2.6683073, z: -2.4067612} + m_LocalPosition: {x: 6.388697, y: -2.32, z: -2.4067612} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_ConstrainProportionsScale: 1 m_Children: @@ -4672,6 +4672,18 @@ MonoBehaviour: _whenSelect: m_PersistentCalls: m_Calls: + - m_Target: {fileID: 1293977771} + m_TargetAssemblyTypeName: Oculus.Interaction.AudioTrigger, Oculus.Interaction.OVR.Samples + m_MethodName: PlayAudio + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 - m_Target: {fileID: 1726060523} m_TargetAssemblyTypeName: BoundWaterScript, Assembly-CSharp m_MethodName: stationCompleted