Python for EV3Dev Cheat Sheet

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

  1. Download the ev3dev flash card image

  2. Download and install Etcher (the tool to flash the card)

  3. Flash the card

  4. Insert the card into the EV3 and turn on to boot to EV3Dev

  5. Establish a network connection
    Step 5 here:
    I hand no success with the USB teathering and ended up using a WiFi dongle.

  6. 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.

  7. Connect to the brick using SSH, then upgrade python-ev3dev with the commands
    sudo apt-get update
        sudo apt-get install python3-ev3dev

  8. Try to edit a simple file through SSH on the brick using Nano
    Demo.... To do....

  9. Download and install Filezilla (a GUI client for copying files to the brick)

  10. Download and install Notepad++

  11. 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.

  12. Demo of how to run a program and pipe the output to a file for debugging.

  13. Work through the examples on the Club Engineer website

  14. Supporting EV3Dev with Python docs are here:
    The best tutorial on EV3Dev & Python I have found:

    Python EV3Dev Docs - Not a huge help

Source Code Fragments

_run   view   |   download
_run is useful for debugging when running the py file on the EV3 causes an error to be written to the screen. _run will redirect the error text to a file called error.txt   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download

club-engineer.bmp   download
You will also need to download club-engineer.bmp and copy it to the same folder as on the brick    view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   view   |   download   download
You will also need to download and place it in the same folder as   view   |   download

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)   view   |   download   view   |   download   view   |   download

Toggle menu