About the Python for EV3 Shield Cheat Sheet
Resources and code fragments to help you get started coding the EV3 with Python and EV3Dev.
Links, steps, and the eventual table of contents for the CE YouTube videos on EV3Dev and Python
- Download the ev3dev flash card image http://www.ev3dev.org/docs/getting-started/
- Download and install Etcher (the tool to flash the card) https://www.etcher.io/
- Flash the card
- Insert the card into the EV3 and turn on to boot to EV3Dev
- Establish a network connection Step 5 here: http://www.ev3dev.org/docs/getting-started/ I hand no success with the USB teathering and ended up using a WiFi dongle.
- Download and install Putty, the tool to SSH (secure shell) into the brick. This will allow you to control the brick from a console on your destkop. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Connect to the brick using SSH, then upgrade python-ev3dev with the commands
sudo apt-get update sudo apt-get install python3-ev3dev
- Try to edit a simple file through SSH on the brick using Nano Demo.... To do....
- Download and install Filezilla (a GUI client for copying files to the brick) https://filezilla-project.org/download.php?type=client
- Download and install Notepad++ https://notepad-plus-plus.org/
- Edit a simple program using Notepad++. Toggle the line endings SFTP it to the brick using Filezilla. Run it on the brick using SSH Set the executable bit Run it on the brick through BrickMan. Discuss shebang.
- Demo of how to run a program and pipe the output to a file for debugging.
- Work through the examples on the Club Engineer website
- Supporting EV3Dev with Python docs are here: The best tutorial on EV3Dev & Python I have found: https://sites.google.com/site/ev3python/ Python EV3Dev Docs - Not a huge help http://python-ev3dev.readthedocs.io/en/latest/index.html
Source Code Fragments
club-engineer.bmp download You will also need to download club-engineer.bmp and copy it to the same folder as 09-display-image-bmp.py on the brick
packagesimple.py download You will also need to download packagesimple.py and place it in the same folder as 34-package-simple.py
packagecompound download You will also need to download the files in packagecompound and unzip them to a folder called packagecompound (the folder name is important as it's referenced in the code)