Laptop Setup
Laptop Setup
How to set up FLL laptops for VS Code, Python, Pybricks and Git/github
Step 1. Install software
• VS Code https://code.visualstudio.com/
Editing python programs. Use the "System Installer".
• Python 3 https://www.python.org/
It's python. Install in c:\python\ (use the "custom
installation" option)
• git for Windows https://git-scm.com/downloads
Be sure to select VS code as your default editor.
• pybricks https://pybricks.com/
https://code.pybricks.com/ and
https://beta.pybricks.com/
Nothing to install on your computer, but you will need to
install it on your robot.
Install VS Code
• Use the Windows
System x64 installer.
Will require the admin
password
Install Python 3
• Choose Customize
Installation. Also,
check the box at the
bottom to add
python.exe to PATH
• Be sure to check
these options
Git installation
• Download the
latest 64 bit version
for windows.
• Be sure
to use
VS Code
as the
default
editor
Click Next, then click
“Next” nine more times.
Then install.
Step 2. Create github account
• http://github.com
• You will need a phone or yubi key to set up 2FA
• Do NOT forget your username and password.
Step 3. Invite each member as a
collaborator
• One of the coaches will invite you to be a collaborator on the team
repository
• Tell the coach your username so they can invite you
Step 4. Accept invitation
• Look at your github notifications. Click “accept”
• Go to the team github repo
• Click on Master-Program-Fall-2023
https://github.com/FLL-Team-24277
Step 5. VS Code Extensions
• Open VS Code and install the following extensions
• Error Lens
• Git-autoconfig
• GitHub Pull Requests and Issues
• Python
• Pylance
• Black
• Black Formatter
• PDF Viewer
• Restart VS Code
• Clone the Team’s Repository and open the project
• Get the link from the Team github repository
• Create a new
folder in your
Documents and
name it “FLL”.
• Go into that folder
and Select as
Repository
Destination
Step 6. Add Python Virtual
Environment
• Add a python virtual environment.
• Ctrl-Shift-P > Python: Create Environment. Just use the defaults.
• Pro-tip: Try typing Ctrl-Shift-P, then “cre env”
• Open PowerShell
• Set-ExecutionPolicy RemoteSigned
• Pro-tip: Just type “set-ex” and then hit Tab, then type “re” and
then hit Tab
• Will need admin password
• Restart VS Code
• Open a new terminal with ctrl-shift-` or Ctrl-Shift-P >
Create Terminal and make sure it is in the python virtual
environment. It will start with a green "(.venv)".
Step 7. Python and Git
Requirements
• pip install -r .\requirements.txt
• Pro-tip: type “pip install req” then hit Tab
• If you entered your name and email address earlier, then you won’t
need to do these next two steps
• git config --global user.name “YourName“
• Pro-tip: After running the user.name command, hit the cursor up-arrow, then
edit the command to run the next command below
• git config --global user.email “[email protected]"
Step 8.
Create Test
File
• Create a new python file, named
teamMemberName-test-
mission.py. Keep it all lowercase
and no spaces. It MUST end with
“.py”
• Copy and paste the code from
the team github page, and save
it
• Note that after saving the file,
the python Black Formatter
should correct the intentional
"incorrect" spacing around the
equals signs and commas.
Step 9. Commit Changes
• Press Ctrl-S to save your 2
test program
• Commit the changes, and
push. It will probably 3
prompt for github
1
registration/login and then
sync all files.
• Just follow the prompts
back to the github
webpage that we left open
Step 10. Install Pybricks
• Install pybricks on each robot at https://beta.pybricks.com/
• If the computer has never connected to a pybricks hub, you will
probably need to manually install the USB drivers
• Name the robot at this time
• Avoid spaces and special characters in the robot name
• Put a label sticker on the top of the robot with the robot name.
Put hub in “Update Mode”
• Preparation:
1.Disconnect the USB cable.
2.Make sure the hub is turned off.
• Enter update mode (see video):
3.Press and hold the Bluetooth button on the hub.
4.Connect the USB cable.
5.Wait for the Bluetooth light to start blinking pink-green-
blue-off.
6.Release the Bluetooth button.
• Click on the start menu,
then type “dev”
2
Step 11. User
Environment Variables
• Create a User environment variable for the
robot name
• Set the variable robotName to the name of
the robot 3
• This should allow the keyboard binding and
tasks to recognize the robot by name
• Restart VS Code and open a new terminal
and then test it with echo $env:robotName
1: Click on Start Menu
2: Type “env”
3: Click on “Edit Environment Variables for your
account” 1
Enter “robotName”