-
Notifications
You must be signed in to change notification settings - Fork 0
/
page40.html
328 lines (270 loc) · 28.1 KB
/
page40.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!DOCTYPE html>
<html >
<head>
<!-- Site made with Mobirise Website Builder v5.9.6, https://mobirise.com -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Mobirise v5.9.6, mobirise.com">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<link rel="shortcut icon" href="assets/images/logo.png" type="image/x-icon">
<meta name="description" content="">
<title>ultrasonic snesor</title>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap-grid.min.css">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap-reboot.min.css">
<link rel="stylesheet" href="assets/parallax/jarallax.css">
<link rel="stylesheet" href="assets/dropdown/css/style.css">
<link rel="stylesheet" href="assets/socicon/css/styles.css">
<link rel="stylesheet" href="assets/theme/css/style.css">
<link rel="preload" href="https://fonts.googleapis.com/css?family=Jost:100,200,300,400,500,600,700,800,900,100i,200i,300i,400i,500i,600i,700i,800i,900i&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Jost:100,200,300,400,500,600,700,800,900,100i,200i,300i,400i,500i,600i,700i,800i,900i&display=swap"></noscript>
<link rel="preload" as="style" href="assets/mobirise/css/mbr-additional.css"><link rel="stylesheet" href="assets/mobirise/css/mbr-additional.css" type="text/css">
</head>
<body>
<section data-bs-version="5.1" class="menu menu2 cid-sFCw1qGFAI" once="menu" id="menu2-f7">
<nav class="navbar navbar-dropdown navbar-expand-lg">
<div class="container-fluid">
<div class="navbar-brand">
<span class="navbar-caption-wrap"><a class="navbar-caption text-black display-7" href="index.html#header2-7">Flora Berkowitz<br>MDEF-Fablab Bcn</a></span>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#navbarSupportedContent" data-bs-target="#navbarSupportedContent" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<div class="hamburger">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav nav-dropdown nav-right" data-app-modern-menu="true"><li class="nav-item"><a class="nav-link link text-black display-4" href="index.html">Home</a></li><li class="nav-item dropdown"><a class="nav-link link dropdown-toggle text-black display-4" href="page53.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Syn_</a><div class="dropdown-menu" aria-labelledby="dropdown-271"><a class="show dropdown-item text-black display-4" href="page72.html">Syn_</a><a class="show dropdown-item text-black display-4" href="page74.html">Video</a><a class="dropdown-item text-black display-4" href="page75.html">About</a><a class="dropdown-item text-black display-4" href="page73.html">Research</a><a class="show dropdown-item text-black display-4" href="page76.html">Workshop Posters</a></div></li><li class="nav-item dropdown"><a class="nav-link link dropdown-toggle text-black display-4" href="page2.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">About</a><div class="dropdown-menu" aria-labelledby="dropdown-231"><a class="dropdown-item text-black display-4" href="page2.html">About</a><a class="show dropdown-item text-black display-4" href="page15.html">CV and contact</a></div>
</li>
<li class="nav-item dropdown"><a class="nav-link link dropdown-toggle text-black display-4" href="index.html#contacts2-1r" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Term 1</a><div class="dropdown-menu" aria-labelledby="dropdown-700"><a class="dropdown-item text-black display-4" href="page1.html">Landing</a><a class="dropdown-item text-black display-4" href="page7.html">Atlas of Weak Signals</a><a class="show dropdown-item text-black display-4" href="page26.html">Design Space</a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page8.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Design Studio</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-736"><a class="show dropdown-item text-black display-4" href="page8.html#content5-35">Rtd toolbox</a><a class="show dropdown-item text-black display-4" href="page25.html">Design Studio Class 23.10.2023 <br></a><a class="dropdown-item show text-black display-4" href="page24.html">First Design Intervention</a><a class="dropdown-item show text-black display-4" href="page20.html">Design Studio Class Laura Benitez</a><a class="dropdown-item show text-black display-4" href="page30.html">Second Design Intervention</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page9.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Documentation</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-947"><a class="dropdown-item show text-black display-4" href="page9.html">Documentation research</a><a class="dropdown-item text-black display-4" href="page12.html">Paradox machine</a></div></div><a class="show dropdown-item text-black display-4" href="page10.html">Github and Digital Fabrication</a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page12.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Paradox Machine</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-353"><a class="show dropdown-item text-black display-4" href="page12.html">Discovery of artefacts</a><a class="dropdown-item show text-black display-4" href="page16.html">The F*ckduck Machine</a></div></div><a class="show dropdown-item text-black display-4" href="page13.html">Materfad</a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page17.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Bio-Zero</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-669"><a class="show dropdown-item text-black display-4" href="page17.html">Bio-Zero</a><a class="dropdown-item show text-black display-4" href="page19.html">Create your GMO</a><a class="show dropdown-item text-black display-4" href="page18.html">Articles and books</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="index.html#contacts2-1r" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Agri-Zero</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-877"><a class="show dropdown-item text-black display-4" href="page21.html">Agri-Zero</a><a class="dropdown-item show text-black display-4" href="page22.html">Seed Analysis</a><a class="show dropdown-item text-black display-4" href="page23.html">Articles and books</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle show text-black display-4" href="page27.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Design With Others</a><div class="dropdown-menu dropdown-submenu show" aria-labelledby="dropdown-217" data-bs-popper="none"><a class="show dropdown-item text-black display-4" href="page27.html">Living With Others</a><a class="show dropdown-item text-black display-4" href="page28.html">Design Intervention</a></div></div><a class="show dropdown-item text-black display-4" href="page14.html">Living with your ideas </a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="index.html#contacts2-1r" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Extended Intelligences</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-573"><a class="show dropdown-item text-black display-4" href="page32.html">Extended Intelligences</a><a class="show dropdown-item text-black display-4" href="page31.html">Project</a></div></div><a class="show dropdown-item text-black display-4" href="page34.html">Design Dialogues</a></div></li><li class="nav-item dropdown"><a class="nav-link link dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Term 2</a><div class="dropdown-menu" aria-labelledby="dropdown-647"><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Design Studio II</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-928"><a class="dropdown-item text-black display-4" href="page46.html">Drifting</a><a class="dropdown-item show text-black display-4" href="page47.html">I1. Humidity sensor prototyping</a><a class="dropdown-item text-black display-4" href="page57.html">I2. Soil battery</a><a class="dropdown-item show text-black display-4" href="page58.html">I.3 Installation: soil battery</a><a class="dropdown-item show text-black display-4" href="page59.html">Video Term II</a></div></div><a class="show dropdown-item text-black display-4" href="page33.html">Designing in a state of climate emergency</a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Future Talks </a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-721"><a class="show dropdown-item text-black display-4" href="page35.html">Designing with values</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page36.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Digital prototyping for design</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-307"><a class="show dropdown-item text-black display-4" href="page36.html">Touch Sensitive Biomaterial</a><a class="show dropdown-item text-black display-4" href="page48.html">Mycelium and Clay printing</a><a class="dropdown-item show text-black display-4" href="page51.html">Micro challenge I</a><a class="dropdown-item show text-black display-4" href="page55.html">Micro Challenge II</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page39.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Communicating Ideas</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-958"><a class="show dropdown-item text-black display-4" href="page39.html">Communicating ideas<br></a><a class="dropdown-item show text-black display-4" href="page43.html">Tandem Project</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Fair Futures</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-111"><a class="show dropdown-item text-black display-4" href="page44.html">Reflection and notes</a><a class="show dropdown-item text-black display-4" href="page45.html">Group project</a></div></div><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Measuring the world</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-713"><a class="show dropdown-item text-black display-4" href="page49.html">Reflection and notes</a><a class="show dropdown-item text-black display-4" href="page50.html">We want to hear the waves</a></div></div><a class="dropdown-item text-black display-4" href="page54.html">Designing with Extended Intelligences</a><a class="show dropdown-item text-black display-4" href="page56.html">Design Dialogues II</a><a class="show dropdown-item text-black display-4" href="page63.html">Research Trip</a></div></li><li class="nav-item dropdown"><a class="nav-link link dropdown-toggle show text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Term 3</a><div class="dropdown-menu show" aria-labelledby="dropdown-914" data-bs-popper="none"><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Design Studio</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-970"><a class="dropdown-item text-black display-4" href="page71.html">Intervention 1</a><a class="dropdown-item show text-black display-4" href="page3.html">Intervention 2</a><a class="dropdown-item show text-black display-4" href="page3.html">Intervention 3</a></div></div><a class="dropdown-item text-black display-4" href="page62.html">Atlas of weak signals</a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page61.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Communicating ideas</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-533"><a class="show dropdown-item text-black display-4" href="page61.html">Communicating ideas</a><a class="dropdown-item show text-black display-4" href="page69.html">Communicating ideas with Laura</a></div></div><a class="dropdown-item text-black display-4" href="page64.html" aria-expanded="false">Design Ethics</a><div class="dropdown"><a class="dropdown-item dropdown-toggle text-black display-4" href="page3.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Digital prototyping for design</a><div class="dropdown-menu dropdown-submenu" aria-labelledby="dropdown-664"><a class="show dropdown-item text-black display-4" href="page65.html">Digital prototyping for design</a><a class="show dropdown-item text-black display-4" href="page66.html">Micro-challenge III</a><a class="dropdown-item text-black display-4" href="page77.html">Task 3 - CNC<br></a><a class="dropdown-item show text-black display-4" href="page65.html">Task 4 - rabbit</a><a class="dropdown-item show text-black text-primary display-4" href="page78.html">Task 5 - Testing Max</a></div></div><a class="show dropdown-item text-black display-4" href="page67.html">MDEFestival hehe</a><a class="dropdown-item text-black display-4" href="page68.html">Future Talk - Helen Torres</a><a class="show dropdown-item text-black display-4" href="page3.html">Critical Transfeminist design</a></div></li><li class="nav-item dropdown"><a class="nav-link link dropdown-toggle text-black display-4" href="index.html#team1-1o" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Master Project</a><div class="dropdown-menu" aria-labelledby="dropdown-892"><a class="dropdown-item text-black display-4" href="page4.html">Initial ideas</a><a class="dropdown-item text-black display-4" href="page60.html">First draft</a><a class="show dropdown-item text-black display-4" href="page73.html">Investigation</a><a class="show dropdown-item text-black display-4" href="page71.html">Intervention I Term III</a><a class="show dropdown-item text-black display-4" href="page37.html">Readings</a></div></li><li class="nav-item dropdown"><a class="nav-link link dropdown-toggle text-black display-4" href="page5.html" data-toggle="dropdown-submenu" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">Testing stuff</a><div class="dropdown-menu" aria-labelledby="dropdown-125"><a class="show dropdown-item text-black display-4" href="page29.html">Traveling with a 3D printer</a><a class="show dropdown-item text-black display-4" href="page40.html">Ultrasonic sensor</a><a class="show dropdown-item text-black display-4" href="page42.html">Passive buzzer</a><a class="show dropdown-item text-black display-4" href="page41.html">Troubleshooting pew pew</a><a class="show dropdown-item text-black display-4" href="page52.html">Kinect stuff </a><a class="show dropdown-item text-black display-4" href="page53.html">Mood</a></div></li></ul>
</div>
</div>
</nav>
</section>
<section data-bs-version="5.1" class="header2 cid-u1UdKZJ58W mbr-fullscreen mbr-parallax-background" id="header2-f8">
<div class="mbr-overlay" style="opacity: 0.7; background-color: rgb(255, 255, 255);"></div>
<div class="container">
<div class="row">
<div class="col-12 col-lg-7">
<h1 class="mbr-section-title mbr-fonts-style mb-3 display-5"><strong>Discovering sensors - Arduino</strong></h1>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="content5 cid-u1UdUoZiPM" id="content5-f9">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10">
<p class="mbr-text mbr-fonts-style display-7"><strong>Library to download from tutorial on Arduino<br></strong>Newping<br><br><strong>Code to show detection of distance on serial monitor<br></strong>#include <NewPing.h><newping.h><br>
<br>NewPing sonar(10, 11, 20);
<br>
<br>void setup() {
<br> Serial.begin(9600);
<br> delay(50);
<br> // put your setup code here, to run once
<br>}
<br>
<br>void loop() {
<br> Serial.print("The Distance is: ");
<br> Serial.println(sonar.ping_cm());
<br> delay(1000);
<br>}</newping.h><br></p>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="video2 cid-u1Ueq2njwP" id="video2-fa">
<div class="container">
<div class="row justify-content-center mt-4">
<div class="col-12 col-md-10 video-block">
<div class="video-wrapper"><iframe class="mbr-embedded-video" src="https://www.youtube.com/embed/Lx7KEaRLOU0?rel=0&amp;mute=1&showinfo=0&autoplay=1&loop=1&playlist=Lx7KEaRLOU0" width="1280" height="720" frameborder="0" allowfullscreen></iframe></div>
<p class="mbr-text pt-2 mbr-fonts-style display-4">
Ma maaan</p>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="image3 cid-u1UeWl7u3E" id="image3-fb">
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-lg-10">
<div class="image-wrapper">
<img src="assets/images/screenshot-2024-01-20.png" alt="Mobirise Website Builder">
<p class="mbr-description mbr-fonts-style mt-2 align-center display-4">
Little circuit <3</p>
</div>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="image3 cid-u1UfoQCXSG" id="image3-fc">
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-lg-10">
<div class="image-wrapper">
<img src="assets/images/img-1774.jpeg" alt="Mobirise Website Builder">
</div>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="content5 cid-u1W71S2zCK" id="content5-fg">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10">
<p class="mbr-text mbr-fonts-style display-7"><strong>Connect to blender through blendix code (doesn't work properly)<br></strong>#include <NewPing.h><newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><newping.h></newping.h><br>
<br>NewPing sonar(10, 11, 20);
<br>
<br>float distance = 0; // Global variable to store the distance
<br>
<br>void setup() {
<br> Serial.begin(115200); // Initialize serial communication with a baud rate of 115200
<br> delay(50);
<br>}
<br>
<br>void loop() {
<br> distance = sonar.ping_cm(); // Measure the distance using the ultrasound sensor
<br>
<br> // Check if an object is in front of the sensor within the range
<br> if (distance > 0 && distance < 20) {
<br> sendRandomValues(); // If an object is detected, send random values
<br> }
<br>
<br> // Add a delay of 1 second
<br> delay(1000);
<br>}
<br>
<br>// Function to generate random meaningful words
<br>String generateRandomText(int length) {
<br> String randomText = "";
<br>
<br> // Define an array of meaningful words
<br> String words[] = {"apple", "banana", "cat", "dog", "elephant", "flower", "guitar", "house", "ice cream", "jungle"};
<br> int numWords = sizeof(words) / sizeof(words[0]);
<br>
<br> for (int i = 0; i < length; i++) {
<br> int randomIndex = random(0, numWords); // Generate a random index to select a word from the array
<br> String randomWord = words[randomIndex];
<br> randomText += randomWord + " ";
<br> }
<br>
<br> randomText.trim(); // Remove the trailing space
<br>
<br> return randomText;
<br>}
<br>
<br>// Function to generate random axis values
<br>String generateRandomAxis() {
<br> String axis = "";
<br> float x = random(-10, 10); // Generate a random floating-point number between -10 and 10 for x
<br> float y = random(-10, 10); // Generate a random floating-point number between -10 and 10 for y
<br> float z = random(-10, 10); // Generate a random floating-point number between -10 and 10 for z
<br>
<br> axis = String(x) + "," + String(y) + "," + String(z); // Concatenate the generated axis values into a single string
<br>
<br> return axis;
<br>}
<br>
<br>// Function to send random values to Blender
<br>void sendRandomValues() {
<br> String textData = generateRandomText(3); // Generate random meaningful text with a desired length
<br> String movementData = generateRandomAxis(); // Generate random axis values
<br> String sendData = movementData + ";" + textData; // Combine the axis values and text data with a semicolon in between
<br>
<br> Serial.println("Distance: " + String(distance) + " cm");
<br> Serial.println("Random Values: " + sendData); // Print the combined data to the serial monitor for communication with Blender
<br> delay(200); // Adjust delay as needed
<br>} </newping.h><br><br><newping.h><strong>Great, the sensor calculates the distance and generates values when triggered, but it doesn't speak to blender. What's next</strong></newping.h><newping.h><strong><br></strong></newping.h></p>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="video2 cid-u1W8mGKlGf" id="video2-fi">
<div class="container">
<div class="row justify-content-center mt-4">
<div class="col-12 col-md-10 video-block">
<div class="video-wrapper"><iframe class="mbr-embedded-video" src="https://www.youtube.com/embed/QSA6eF6amAM?rel=0&amp;mute=1&showinfo=0&autoplay=1&loop=1&playlist=QSA6eF6amAM" width="1280" height="720" frameborder="0" allowfullscreen></iframe></div>
</div>
</div>
</div>
</section>
<section data-bs-version="5.1" class="content5 cid-u1XctEGR7W" id="content5-fj">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12 col-lg-10">
<p class="mbr-text mbr-fonts-style display-7"><strong>This third code speaks to blender. The ultrasonic sensor when triggered, moves the blender model of 1m on y axis.
</strong><br>
<br>#include <NewPing.h><newping.h><br>
<br>NewPing sonar(10, 11, 20); // Ultrasonic sensor configuration
<br>
<br>float totalDistance = 0.0; // Variable to store the total distance moved
<br>
<br>void setup() {
<br>Serial.begin(9600); // Initialize serial communication with a baud rate of 9600
<br>}
<br>
<br>// Function to send data to Blender
<br>void sendtoBlender(float x) {
<br>String sendData = String(x) + ",0,0," + String(x) + ",0,0," + String(x) + ",0,0;";
<br>Serial.println(sendData); // Print the combined data to the serial monitor for communication with Blender
<br>}
<br>
<br>// Function to generate random meaningful words
<br>String generateRandomText(int length) {
<br>String randomText = "";
<br>
<br>// Define an array of meaningful words
<br>String words[] = {"apple", "banana", "cat", "dog", "elephant", "flower", "guitar", "house", "ice cream", "jungle"};
<br>int numWords = sizeof(words) / sizeof(words[0]);
<br>
<br>for (int i = 0; i < length; i++) {
<br>int randomIndex = random(0, numWords); // Generate a random index to select a word from the array
<br>String randomWord = words[randomIndex];
<br>randomText += randomWord + " ";
<br>}
<br>
<br>randomText.trim(); // Remove the trailing space
<br>
<br>return randomText;
<br>}
<br>
<br>// Function to generate random axis values
<br>String generateRandomAxis() {
<br>String axis = "";
<br>float x = random(-10, 10); // Generate a random floating-point number between -10 and 10 for x
<br>float y = random(-10, 10); // Generate a random floating-point number between -10 and 10 for y
<br>float z = random(-10, 10); // Generate a random floating-point number between -10 and 10 for z
<br>
<br>axis = String(x) + "," + String(y) + "," + String(z); // Concatenate the generated axis values into a single string
<br>
<br>return axis;
<br>}
<br>
<br>// Function to generate and send fixed data to Blender
<br>void generateAndSendData() {
<br>// Increment the total distance by 1 meter
<br>totalDistance += 1.0;
<br>
<br>// Generate the data in the correct format for Blender
<br>sendtoBlender(totalDistance);
<br>}
<br>
<br>void loop() {
<br>// Measure the distance using the ultrasonic sensor
<br>float distance = sonar.ping_cm();
<br>
<br>// Check if an object is detected within the specified distance range (adjust as needed)
<br>if (distance > 0 && distance < 20) {
<br>// Call the function to generate and send data when an object is detected
<br>generateAndSendData();
<br>delay(2000); // Wait for 2 seconds to avoid rapid multiple triggers (adjust as needed)
<br>}
<br>}</newping.h></p>
</div>
</div>
</div>
</section><section class="display-7" style="padding: 0;align-items: center;justify-content: center;flex-wrap: wrap; align-content: center;display: flex;position: relative;height: 4rem;"><a href="https://mobiri.se/3095965" style="flex: 1 1;height: 4rem;position: absolute;width: 100%;z-index: 1;"><img alt="" style="height: 4rem;" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="></a><p style="margin: 0;text-align: center;" class="display-7">‌</p><a style="z-index:1" href="https://mobirise.com/html-builder.html">HTML Creator</a></section><script src="assets/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="assets/parallax/jarallax.js"></script> <script src="assets/smoothscroll/smooth-scroll.js"></script> <script src="assets/ytplayer/index.js"></script> <script src="assets/dropdown/js/navbar-dropdown.js"></script> <script src="assets/playervimeo/vimeo_player.js"></script> <script src="assets/theme/js/script.js"></script>
</body>
</html>