Skip to content

Commit

Permalink
Finished chapter 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaishnav-Sabari-Girish committed Dec 23, 2024
1 parent 99586dc commit a891908
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 8 deletions.
33 changes: 32 additions & 1 deletion book/chapter_3.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ <h1 id="chapter-3-how-to-use-aci-part---2"><a class="header" href="#chapter-3-ho
<ol>
<li><a href="#compile-code">Compile Code for a specific board</a></li>
<li><a href="#upload-code">Upload Code to the board</a></li>
<li><a href="#edit-configuration">Add 3rd party cores and install them using <code>arduino-cli</code></a></li>
<li><a href="#install-libraries">Install Libraries</a>
<br><br></li>
</ol>
<h2 id="compile-code"><a class="header" href="#compile-code">Compile Code</a></h2>
<p>To compile the code in the Sketch you created <a href="./chapter_2.html#edit-a-sketch">previously</a> , we open the
Expand All @@ -167,6 +168,36 @@ <h2 id="compile-code"><a class="header" href="#compile-code">Compile Code</a></h
<p>Since you have already selected the board , it will compile the code for that specific board.</p>
<p>In the following example we will compile the code for an Arduino Nano.</p>
<p><img src="images/recordings/compile_code.gif" alt="compile code gif" /></p>
<p><br><br></p>
<h2 id="upload-code"><a class="header" href="#upload-code">Upload Code</a></h2>
<p>To upload the code , you need to first <a href="#compile-code">Compile the code</a> and then back in the homepage ,
navigate to the <strong>Upload Code</strong> option and press <strong>Enter</strong></p>
<p>Once you are inside the <strong>Upload Code</strong> , you will be asked to choose the Serial Port your board
is connected to.</p>
<p>In Linux/macOS , the Serial port will show up as <code>/dev/ttyUSB0</code> and for windows , it will show up as
<code>COM7</code> or any other number other than 7.</p>
<p>After selecting the Serial Port , you will then be asked to choose between OLD and NEW Bootloaders.
OLD Bootloaders as usually only for Arduino Nanos , so make sure you do not mess up that one.
Choose between OLD and NEW Bootloaders and the the code will be uploaded.</p>
<p>In the below recordings , one will be for Arduino Nano (Old Bootloader) and one for the WeMOS D1 R1
(New Bootloader).</p>
<h3 id="old-bootloader"><a class="header" href="#old-bootloader">Old Bootloader.</a></h3>
<p><img src="images/recordings/upload_code_old.gif" alt="Old Bootloader" /></p>
<h3 id="new-bootloader"><a class="header" href="#new-bootloader">New Bootloader</a></h3>
<p><img src="images/recordings/upload_code_new.gif" alt="New Bootloader" /></p>
<p><br><br></p>
<h2 id="install-libraries"><a class="header" href="#install-libraries">Install Libraries</a></h2>
<p>To install libraries , there is no need to Select a board or Create a New Sketch.</p>
<p>Open a new terminal and type <code>aci</code>.
The Navigate to the <strong>Install Libraries</strong> option using the Arrow Keys and click <strong>Enter</strong></p>
<p>Now an input dialog box will appear prompting for the name of the library.
Enter the name of the library and press <strong>Enter</strong></p>
<p>When do you do , there will be a list of libraries that have the name you entered.
Select the one you want to install and click <strong>Enter</strong></p>
<p>Let us install the <strong>DHT11</strong> Library by <strong>Dhrubha Saha</strong>.</p>
<p>To check if the library has been installed , type <code>arduino-cli lib list</code> and check the table
for the library you just installed. If it is present then the library has been installed successfully.</p>
<p><img src="images/recordings/lib_install.gif" alt="Lib Install" /></p>

</main>

Expand Down
2 changes: 1 addition & 1 deletion book/images/recordings/MyFirstSketch/MyFirstSketch.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const int ledPin = 13; //Depends on the board , for Uno and Nano it is pin 13
const int ledPin = 2; //Depends on the board , for Uno and Nano it is pin 13

void setup() {
//This function will run only once when the board boots up
Expand Down
Binary file added book/images/recordings/lib_install.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/images/recordings/upload_code_new.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/images/recordings/upload_code_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 32 additions & 1 deletion book/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ <h4 id="note--1"><a class="header" href="#note--1"><strong><strong>NOTE</strong>
<ol>
<li><a href="chapter_3.html#compile-code">Compile Code for a specific board</a></li>
<li><a href="chapter_3.html#upload-code">Upload Code to the board</a></li>
<li><a href="chapter_3.html#edit-configuration">Add 3rd party cores and install them using <code>arduino-cli</code></a></li>
<li><a href="chapter_3.html#install-libraries">Install Libraries</a>
<br><br></li>
</ol>
<h2 id="compile-code"><a class="header" href="#compile-code">Compile Code</a></h2>
<p>To compile the code in the Sketch you created <a href="./chapter_2.html#edit-a-sketch">previously</a> , we open the
Expand All @@ -474,6 +475,36 @@ <h2 id="compile-code"><a class="header" href="#compile-code">Compile Code</a></h
<p>Since you have already selected the board , it will compile the code for that specific board.</p>
<p>In the following example we will compile the code for an Arduino Nano.</p>
<p><img src="images/recordings/compile_code.gif" alt="compile code gif" /></p>
<p><br><br></p>
<h2 id="upload-code"><a class="header" href="#upload-code">Upload Code</a></h2>
<p>To upload the code , you need to first <a href="chapter_3.html#compile-code">Compile the code</a> and then back in the homepage ,
navigate to the <strong>Upload Code</strong> option and press <strong>Enter</strong></p>
<p>Once you are inside the <strong>Upload Code</strong> , you will be asked to choose the Serial Port your board
is connected to.</p>
<p>In Linux/macOS , the Serial port will show up as <code>/dev/ttyUSB0</code> and for windows , it will show up as
<code>COM7</code> or any other number other than 7.</p>
<p>After selecting the Serial Port , you will then be asked to choose between OLD and NEW Bootloaders.
OLD Bootloaders as usually only for Arduino Nanos , so make sure you do not mess up that one.
Choose between OLD and NEW Bootloaders and the the code will be uploaded.</p>
<p>In the below recordings , one will be for Arduino Nano (Old Bootloader) and one for the WeMOS D1 R1
(New Bootloader).</p>
<h3 id="old-bootloader"><a class="header" href="#old-bootloader">Old Bootloader.</a></h3>
<p><img src="images/recordings/upload_code_old.gif" alt="Old Bootloader" /></p>
<h3 id="new-bootloader"><a class="header" href="#new-bootloader">New Bootloader</a></h3>
<p><img src="images/recordings/upload_code_new.gif" alt="New Bootloader" /></p>
<p><br><br></p>
<h2 id="install-libraries"><a class="header" href="#install-libraries">Install Libraries</a></h2>
<p>To install libraries , there is no need to Select a board or Create a New Sketch.</p>
<p>Open a new terminal and type <code>aci</code>.
The Navigate to the <strong>Install Libraries</strong> option using the Arrow Keys and click <strong>Enter</strong></p>
<p>Now an input dialog box will appear prompting for the name of the library.
Enter the name of the library and press <strong>Enter</strong></p>
<p>When do you do , there will be a list of libraries that have the name you entered.
Select the one you want to install and click <strong>Enter</strong></p>
<p>Let us install the <strong>DHT11</strong> Library by <strong>Dhrubha Saha</strong>.</p>
<p>To check if the library has been installed , type <code>arduino-cli lib list</code> and check the table
for the library you just installed. If it is present then the library has been installed successfully.</p>
<p><img src="images/recordings/lib_install.gif" alt="Lib Install" /></p>

</main>

Expand Down
2 changes: 1 addition & 1 deletion book/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion book/searchindex.json

Large diffs are not rendered by default.

56 changes: 54 additions & 2 deletions src/chapter_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ By the end of this chapter , you will be able to

1. [Compile Code for a specific board](#compile-code)
2. [Upload Code to the board](#upload-code)
3. [Add 3rd party cores and install them using `arduino-cli`](#edit-configuration)

3. [Install Libraries](#install-libraries)
<br><br>
## Compile Code

To compile the code in the Sketch you created [previously](./chapter_2.md#edit-a-sketch) , we open the
Expand All @@ -19,3 +19,55 @@ Since you have already selected the board , it will compile the code for that sp
In the following example we will compile the code for an Arduino Nano.

![compile code gif](images/recordings/compile_code.gif)

<br><br>

## Upload Code

To upload the code , you need to first [Compile the code](#compile-code) and then back in the homepage ,
navigate to the **Upload Code** option and press **Enter**

Once you are inside the **Upload Code** , you will be asked to choose the Serial Port your board
is connected to.

In Linux/macOS , the Serial port will show up as `/dev/ttyUSB0` and for windows , it will show up as
`COM7` or any other number other than 7.

After selecting the Serial Port , you will then be asked to choose between OLD and NEW Bootloaders.
OLD Bootloaders as usually only for Arduino Nanos , so make sure you do not mess up that one.
Choose between OLD and NEW Bootloaders and the the code will be uploaded.

In the below recordings , one will be for Arduino Nano (Old Bootloader) and one for the WeMOS D1 R1
(New Bootloader).

### Old Bootloader.

![Old Bootloader](images/recordings/upload_code_old.gif)

### New Bootloader

![New Bootloader](images/recordings/upload_code_new.gif)

<br><br>

## Install Libraries

To install libraries , there is no need to Select a board or Create a New Sketch.

Open a new terminal and type `aci`.
The Navigate to the **Install Libraries** option using the Arrow Keys and click **Enter**

Now an input dialog box will appear prompting for the name of the library.
Enter the name of the library and press **Enter**

When do you do , there will be a list of libraries that have the name you entered.
Select the one you want to install and click **Enter**

Let us install the **DHT11** Library by **Dhrubha Saha**.

To check if the library has been installed , type `arduino-cli lib list` and check the table
for the library you just installed. If it is present then the library has been installed successfully.

![Lib Install](images/recordings/lib_install.gif)

You have successuflly , compiled and uploaded a sketch and also installed a library.
2 changes: 1 addition & 1 deletion src/images/recordings/MyFirstSketch/MyFirstSketch.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const int ledPin = 13; //Depends on the board , for Uno and Nano it is pin 13
const int ledPin = 2; //Depends on the board , for Uno and Nano it is pin 13

void setup() {
//This function will run only once when the board boots up
Expand Down
Binary file added src/images/recordings/lib_install.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/recordings/upload_code_new.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/recordings/upload_code_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a891908

Please sign in to comment.