Skip to content

Commit 11ce25c

Browse files
committed
updates to install instructions
1 parent 5eb1308 commit 11ce25c

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

lessons/assembly/code_install.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
11
# Install the Code
22

3-
Open up Thonny and make sure the rover is turned off. Always be sure to have the battery power off to the Pico before plugging in the USB cable.
3+
Open up Thonny and make sure the **rover is turned off**. Always be sure to have the battery power off to the Pico before plugging in the USB cable.
44

5-
Once the rover is switched off, plug in the USB cable. If Thonny doesn't recognize the Pico, try hitting the STOP button. If that doesn't work try clicking the bottom right to choose the correct device(MicroPyton on Pico).
5+
Once the rover is switched off, plug in the USB cable. If Thonny doesn't recognize the Pico, try hitting the STOP button. If that doesn't work try clicking the bottom right to choose the correct device : MicroPyton(Raspberry Pi Pico).
66

7-
When Thonny detects the Pico, copy the contents from [motor_class.py](https://raw.githubusercontent.com/javaplus/MadScientist/refs/heads/main/code/motor_class.py) into a new/blank Thonny window.
7+
#### Motor Class
8+
9+
When Thonny detects the Pico, copy the contents from [motor_class.py](https://raw.githubusercontent.com/javaplus/MadScientist/refs/heads/main/code/motor_class.py) into a new/blank Thonny window (File->New).
810
Save this file onto the Pico as `motor_class.py`.
911

12+
#### Hit Event
13+
Now create a new Thonny tab(File->New) and copy the contents of [hitevent.py](https://raw.githubusercontent.com/javaplus/MadScientist/refs/heads/main/code/hitevent.py) into the new Thonny tab.
14+
Save this file onto the Pico as `hitevent.py`.
15+
16+
#### Basic Game
17+
Now create a new Thonny tab and copy the contents of [basicgame.py](https://raw.githubusercontent.com/javaplus/MadScientist/refs/heads/main/code/basicgame.py) into the new Thonny tab.
18+
Save this file onto the Pico as `basicgame.py`.
19+
20+
#### Main
21+
1022
Now create a new Thonny tab(File->New) and copy the contents of [main.py](https://raw.githubusercontent.com/javaplus/MadScientist/refs/heads/main/code/main.py) into the new Thonny tab.
11-
Now change the value of the ROVER_NAME variable to be something unique. This will be the bluetooth advertised name of your Rover. Change this to something you can easily remember and unique if doing this with a large group of others.
23+
Now change the value of the `ROVER_NAME` variable to be something unique. This will be the bluetooth advertised name of your Rover. Change this to something you can easily remember and unique if doing this with a large group of others.
1224
Below is the code you need to change... change the "sharkbot1" value to your special name:
1325
```Python
1426

1527
# ROVER_NAME needs to be a unique name for your rover. It will be the advertised bluetooth device name
1628
ROVER_NAME = "sharkbot1"
1729

1830
```
19-
2031
After changing the ROVER_NAME value, save the code to the Pico as `main.py`.
2132

2233
**Fun Fact**: any code you save into `main.py` at the root of the Pico will run automatically when it's powered up.
2334

24-
After saving the `main.py` and `motor_class.py` to the Pico, make sure to have the main.py window up in Thonny and click the "Run" button. See if there are any errors in the Shell.
25-
If you see an error about a picozero library or module, be sure to follow these steps to [install picozero onto the Pico](https://picozero.readthedocs.io/en/latest/gettingstarted.html#install-picozero-from-pypi-in-thonny).
35+
#### Try It Out!
36+
37+
After saving the `motor_class.py`, `hitevent.py`, `basicgame.py`, and `main.py` to the Pico, make sure to have the `main.py` window up in Thonny and click the "Run" button. See if there are any errors in the Shell.
38+
If you see an error about a **picozero** library or module, be sure to follow these steps to [install picozero onto the Pico](https://picozero.readthedocs.io/en/latest/gettingstarted.html#install-picozero-from-pypi-in-thonny).
39+
40+
If you there are no errors, it's time to test it out!
41+
42+
Since testing it out means using the mad scientist app to control the motors, you may want to lift the Rover off the ground while connected to the USB cable. You can use one of the included clear dixie cups upside down under the Rover to keep the tracks off the ground.
43+
44+
![Rover Lift](/lessons/images/assembly/lift.jpg)
45+
Now open the mad scientist app and connect to the Rover. Be sure to keep the power switch off on the Rover.
2646

27-
If you see no errors, try to use the mad scientist app to connect to the Rover. Be sure to keep the power switch off on the Rover.
2847
When the RGB eyes are flashing blue, that means the rover is advertising and waiting for a bluetooth connection.
29-
In the mad scientist app, type in the value you put for the ROVER_NAME variable to make it easier to find your rover and then hit `CONNECT`.
48+
In the mad scientist app, type in the value you put for the `ROVER_NAME` variable to make it easier to find your rover and then hit `CONNECT`.
49+
50+
When the app is connected to the Rover, the eyes should turn green. Now try to move the joystick in the app to test the motor control is working. If any of the movement is reversed, you can simply go to the settings menu of the app and reverse the controls.
51+
52+
3053

lessons/images/assembly/lift.jpg

2.06 MB
Loading

0 commit comments

Comments
 (0)