pibot:lesson2:softwarewin
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pibot:lesson2:softwarewin [2021/07/02 21:05] – [Software Explanation] Added description of how code works jstruebel | pibot:lesson2:softwarewin [2022/10/20 19:53] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Software Setup ====== | ||
+ | |||
+ | - Open the putty app from the Applications\PuTTY\< | ||
+ | - Type " | ||
+ | - Click the " | ||
+ | - If a "PuTTY Security Alert" window pops up, click the " | ||
+ | - Type " | ||
+ | - Type the following command and press enter to change to the directory for the PiBbot code\\ \\ < | ||
+ | - Type the following command and press enter to download the Python code for this lesson\\ \\ < | ||
+ | - Make sure that the PiBot is facing along the black tape path | ||
+ | - Type the following command and press enter to make the PiBot follow the black tape path\\ \\ < | ||
+ | - Hold down the Ctrl + C keys to stop the PiBot | ||
+ | - Type the following command and press enter to close the SSH connection\\ \\ < | ||
+ | |||
+ | ===== Software Explanation ===== | ||
+ | |||
+ | - To view the code that makes the PiBot run perform the following steps | ||
+ | - Open the VSCode from the Applications directory on the flash drive | ||
+ | - Click on the small green square in the bottom left corner of the screen\\ \\ <WRAP box>{{ : | ||
+ | - Select the " | ||
+ | - Type " | ||
+ | - Click the "Open Folder" | ||
+ | - Select the " | ||
+ | - Select the picar-line-tracking.py file in the list on the left\\ \\ <WRAP box>{{ : | ||
+ | - Find line 37 in the picar-line-tracking.py file. What is the name of the variables on that line and the ones below it? What do you think they are for based on their names?\\ \\ <WRAP round tip>If you don't remember what a variable is, review the description from [[: | ||
+ | - Find the places in the code where the sensor# variables are used. What do you think the sts# variables are for? Is that different from what you thought earlier?\\ \\ <WRAP round tip>The " | ||
+ | - Find the other places in the code where the " | ||
+ | - Look at line 114 in the code. What do you think this line does?\\ \\ <WRAP round tip>The " | ||
+ | - The PiBot moves pretty jerkily as it tries to stay on the line. How do you think you can change the code so that it follows the line more smoothly? Make those changes to the code and save it with File-> | ||
+ | - Open a terminal in Visual Studio Code from the Terminal-> | ||
+ | - Type the following command and press enter to make the PiBot move with your changes\\ \\ < | ||
+ | - When you're finished testing out your changes type the following command in the terminal and press enter to shutdown the PiBot\\ \\ < | ||
+ | - Click on the small green rectangle in the bottom left corner of the screen and select "Close Remote Connection" | ||
+ | - Wait 3-5 minutes for the green light on the Raspberry Pi to stop flashing and turn off the switch on the PiBot battery | ||
+ | |||
+ | [[: | ||
+ | |||