|
1 | 1 | # Getting Starting with your XRP Robot
|
2 | 2 |
|
3 |
| -- First steps of tutorial borrowed from [here](https://projects.raspberrypi.org/en/projects/get-started-pico-w/1) |
| 3 | +### Step 1: Plug XRP Robot Controller Board into Computer |
4 | 4 |
|
5 |
| -# Step 1: Install Micropython on your XRP Robot Controller: |
| 5 | +### Step 2: Navigate to [xrpcode.wpi.edu](https://xrpcode.wpi.edu) |
6 | 6 |
|
| 7 | +- Follow instructions there to install MicroPython and the libraries onto the board |
7 | 8 |
|
8 |
| -### Download the latest version of Raspberry Pi Pico W firmware [here](https://rpf.io/pico-w-firmware) |
| 9 | +### Step 3: Navigate to the tutorial linked there to learn how to use the bot! |
9 | 10 |
|
10 |
| -Connect the small end of your micro USB cable to the Raspberry Pi Pico W. |
| 11 | +$~$ |
11 | 12 |
|
12 |
| - |
13 |
| - |
14 |
| -Hold down the BOOTSEL button on your Raspberry Pi Pico W. |
15 |
| - |
16 |
| - |
17 |
| - |
18 |
| -Connect the other end to your desktop computer, laptop, or Raspberry Pi. |
19 |
| - |
20 |
| - |
21 |
| - |
22 |
| -Your file manager should open up, with Raspberry Pi Pico being show as an externally connected drive. Drag and drop the firmware file you downloaded into the file manager. Your Raspberry Pi Pico should disconnect and the file manager will close. |
23 |
| - |
24 |
| - |
25 |
| - |
26 |
| - |
27 |
| -# Step 2: Installing dev environment (Mu) |
28 |
| - |
29 |
| - |
30 |
| -### Download the latest version of the Mu editor [here](https://codewith.mu) |
31 |
| - |
32 |
| -Open Mu, and select the RP2040 Option (Or whichever option represents using Micropython for the board you have) |
33 |
| - |
34 |
| - |
35 |
| - |
36 |
| -## Step 3: Installing the library using mip |
37 |
| - |
38 |
| -Open up a new file in mu. |
39 |
| - |
40 |
| -Copy the following code into that file: |
41 |
| - |
42 |
| -```python |
43 |
| -import network |
44 |
| -import mip |
45 |
| -import time |
46 |
| - |
47 |
| -def install_update_library(wifi_ssid, wifi_password, timeout = 5): |
48 |
| - |
49 |
| - wlan = network.WLAN(network.STA_IF) |
50 |
| - # Configure board to connect to wifi |
51 |
| - wlan.active(True) |
52 |
| - wlan.connect(wifi_ssid,wifi_password) |
53 |
| - start_time = time.time() |
54 |
| - # Wait until connection is confirmed before attempting install |
55 |
| - while not wlan.isconnected(): |
56 |
| - print("Connecting to network, may take a second") |
57 |
| - if time.time() > start_time+timeout: |
58 |
| - print("Failed to connect to network, please try again") |
59 |
| - wlan.disconnect() |
60 |
| - return |
61 |
| - time.sleep(0.25) |
62 |
| - # Install up-to-date library files and dependencies |
63 |
| - mip.install("github:Open-STEM/XRP_MicroPython") |
64 |
| - # Disconnect and disable wifi, since it is no longer needed |
65 |
| - wlan.disconnect() |
66 |
| - wlan.active(False) |
67 |
| - |
68 |
| -install_update_library("your-ssid","your-password") |
69 |
| -``` |
70 |
| - |
71 |
| -Edit the method call at the bottom to include your wifi's details, then hit run. |
72 |
| - |
73 |
| -Check the Serial Monitor to confirm that the libraries were properly installed. |
| 13 | +### That's it! Happy Learning! |
0 commit comments