Skip to content
Snippets Groups Projects
Commit 17460b25 authored by Charlotte Vandenbulcke's avatar Charlotte Vandenbulcke
Browse files

adding video hum and temp on week11 page

parent 06bb0fd8
No related branches found
No related tags found
No related merge requests found
Pipeline #450310 passed
......@@ -54,7 +54,7 @@
<section>
<h3>Group Assignment</h3>
<h4>Measuring Ultrasonic Distance Sensor (infos from <a href="https://components101.com/sensors/ultrasonic-sensor-working-pinout-datasheet" target="_blank">Components 101</a>)</h4>
<h4>Measuring HC-SR04 Ultrasonic sensor (infos from <a href="https://components101.com/sensors/ultrasonic-sensor-working-pinout-datasheet" target="_blank">Components 101</a>)</h4>
<p>This sensor is a very popular sensor used in many applications where measuring distance or sensing objects are required.</p>
......@@ -81,6 +81,53 @@
</ul>
<h5>Test with the Ultrasonic Sensor (from <a href="https://projecthub.arduino.cc/Isaac100/getting-started-with-the-hc-sr04-ultrasonic-sensor-7cabe1" target="_blank">Project Hub Arduino</a>)</h5>
<pre>
<code>
/*
* HC-SR04 example sketch
*
* https://create.arduino.cc/projecthub/Isaac100/getting-started-with-the-hc-sr04-ultrasonic-sensor-036380
*
* by Isaac100
*/
//define the pins that Trig and Echo are connected to
const int trigPin = 2;
const int echoPin = 1;
//declare 2 floats, duration and distance, which will hold the length of the sound wave and how far away the object is
float duration, distance;
void setup() {
pinMode(trigPin, OUTPUT); //declare the Trig pin as an output
pinMode(echoPin, INPUT); //declare the Echo pin as an input
Serial.begin(9600); //start Serial communications
}
void loop() {
digitalWrite(trigPin, LOW); //set the trigPin low for 2 microseconds just to make sure
delayMicroseconds(2); //that the pin in low first
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration*.0343)/2;
Serial.print("Pulse: ");
Serial.print(duration);
Serial.println("micro seconds");
Serial.print("Distance: ");
Serial.print(distance);
Serial.println("cm");
Serial.println(" ");
delay(1000);
}
</code>
</pre>
<p>Link to our <a href="https://fabacademy.org/2024/labs/fabc/group-assignment/week011/" target="_blank">Group page</a></p>
</section>
......@@ -147,7 +194,7 @@
<span class="object">
<video width="600" height="300" controls>
<source src="../images/...mp4" type="video/mp4">
<source src="../images/humidity-and-temperature.mp4" type="video/mp4">
</video>
</span>
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment