Commit cbb3569a authored by FrigobarJenkins's avatar FrigobarJenkins
Browse files

Nuove slide con istruzioni linux e riformattazione

parent 130142b5
Pipeline #1122 passed with stage
in 1 minute and 1 second
......@@ -8,22 +8,68 @@
<a href= https://tinyurl.com/3ndcc2am>
<b><u>link</u></b><br>
</A></p>
<p class="fragment">If you'll follow them correctly you can skip this part</p>
</section>
<section>
<h3>Open the IDE</h3>
<h4 class="fragment" data-fragment-index="0">We'll see something like this</h4>
<h2>For Linux only</h2>
<p>
<b>Python 3</b> is mandatory </p>
<p>Install the <b>pyserial</b> Python module through pip:</p>
<code>
sudo apt install python-pip <br>
pip install --user serial<br>
</code>
</p>
</section>
<section> <h2>Install the SDK</h2>
<p>Check provided instructions for reference and <b>troubleshooting</b> tips</p></section>
<section><h3>Open the IDE</h3></section>
<section>
<h2>For Linux only</h2>
<p>Set the user in the correct group with the code via terminal:</p>
<code>
sudo usermod -aG uucp [username] #for Arch
</code>
<p>If you're running <b>Debian-like OS</b> you will be prompted to be added automatically. Click <b>add</b></p>
<img data-fragment-index="0" data-src="./images/ubuntu.png" style="height:50%;"/>
</section>
<section>
</section>
<section>
<h4 class="fragment" data-fragment-index="0">We should see something like this</h4>
<img class="fragment shadow" data-fragment-index="0" data-src="./images/ide_start.png" style="height:50%;"/>
</section>
<section>
<h4>First thing to do</h4>
<p class="fragment">Open the IDE preferences, from the <b>File</b> menu or by using the <b>CTRL + COMMA</b> hotkey</p>
<p class="fragment">Paste the SDK Espressif json URL as shown:<br>
<b><em>https://dl.espressif.com/dl/package_esp32_index.json</em></b>
<p class="fragment"><img class="fragment shadow" data-src="./images/impostazioniconfreccia.png" style="height:90%;"> </p>
</section>
<section>
<h5 class="fragment">Add support for our board</h5>
<p class="fragment">Go to <b>Tools</b> &gt; <b>Board</b> &gt; <b>Boards Manager...</b></p>
<img class="fragment shadow" data-src="./images/ide_boards_manager.png" style="height:40%;"/>
<p class="fragment">We have to install "<b>ESP32</b>"</p>
<p class="fragment">We have to install "<b>esp32</b>"</p>
</section>
<section>
<h4>Select our board</h4>
<p>From <b>Tools</b> &gt; <b>Board</b> select "<b>NodeMCU - 32S</b>"</p>
<h4>To select our board</h4>
<p>From <b>Tools</b> &gt; <b>Board</b> select "<b>ESP32 Dev Module</b>"</p>
<p>Then we connect the board,<br/>
from <b>Tools</b> &gt; <b>Port</b> we select the port of the board</p>
from <b>Tools</b> &gt; <b>Port</b> we select the port of the board.<br>
It should be named <b>COM1</b> or similar.</p>
</section>
<section>
<p><b>Arduino IDE</b> comes included with several <b>libraries</b> out of the box to
manage all of the official board capabilities,but it is possible to install more via
the <b>Library Manager </b>:
<p>Navigate to <b> Sketch </b><b>#include library</b><b>Library Manager...</b> or use the <b>CTRL + SHIFT + I</b> hotkey</p></p>
Search and install the following library:
<dl>
<ul type = "circle">
<b><li>UniversalTelegramBot</b> (version 1.1.0)</li>
</ul>
</dl>
</section>
## Test our setup
## Let's test our setup
----
......@@ -108,4 +108,4 @@ digitalWrite(led, LOW);
delay(1000);
```
The **digitalWrite** fuction powers the specified pin since we specified **high** as an argument, turning the led on. Then, the **delay** function makes it wait one second (1000 milliseconds) and turns it off (**low** is passed, so it will output 0V), then it waits another second and the cycle repeats
\ No newline at end of file
The **digitalWrite** fuction powers the specified pin since we specified **high** as an argument, turning the led on. Then, the **delay** function makes it wait one second (1000 milliseconds) and turns it off (**low** is passed, so it will output **0V**), then it waits another second and the cycle repeats
......@@ -16,8 +16,12 @@ Photoresistors, also known as **LDR** (light dependent resistors), are light-sen
----
During a continuous exposure to light, the resistance drops exponentially to a few Ωs.
Its settling time latency is about 10ms, therefore it’s not ideal for controlling circuits in rapidly-changing light environnements
During a continuous exposure to **light**, the resistance drops exponentially to a few Ωs.
Its settling time **latency** is about 10ms, therefore it’s not ideal for controlling circuits in rapidly-changing light environnements
----
The ones we are going to use today are **Cadmium Sulfide LDR** which perform better with the visible light spectrum.
<img src="./images/graf1.png" alt="Graph" style="width:30%;"/>
......@@ -29,9 +33,9 @@ So, in few words, a photoresistor is something we can use as a **light sensor**
----
We will do a small sketch that reads the quantity of light and prints it on the computer
We will do a small **sketch** that reads the quantity of light and prints it on the computer
But first, we need to build the circuit
But first, we need to **build the circuit**
----
......
......@@ -16,7 +16,7 @@ void setup() {
pinMode(pin, INPUT);
}
void loop() {
void loop() {
int val = analogRead(pin);
Serial.println(val);
delay(500);
......@@ -33,7 +33,7 @@ void loop() {
const int pin = 35;
```
Here we are declaring a constant named **pin** with a value of 35, since we are reading values from pin **35**. This allows us to use a name instead of a number to refere to the pin
Here we are declaring a constant named **pin** with a value of 35, since we are reading values from **pin 35**. This allows us to use a name instead of a number to refere to the pin
----
......@@ -84,7 +84,7 @@ To make things more graphical, go to
**Tools****Serial Plotter**
<small>Strumenti → Plotter seriale</small>
<small>Strumenti → Plotter seriale</small>
The IDE will show you a **plot** of how the values evolve in time
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment