To start learning Python on Gamebuino, you don't need much: a Gamebuino with CircuitPython installed, as well as the Mu code editor!
CircuitPython is the program that will allow you to execute Python code on your Gamebuino. To install it, proceed in the same way as to install a game.
1.Download the zip file. 2.Extract the archive. It must contain a folder named "CircuitPython". 3.Copy-paste that folder to the root of the Gamebuino's SD card.
And that's it ! Your Gamebuino is now ready to read some Python code !
For more informations about CircuitPython for Gamebuino, go to the creation page.
To code in Python, you can use any text editor you want. However, in this workshop, we recommend that you use Mu. In addition to being very simple to get started, it will also help us to display errors.
It turned out the installation of Mu-editor is quite complicated on most of Linux distributions. For Arch-Linux the package is distributed in the official user repository. So you just have to install it with your usual package manager. For the other distributions (Ubuntu, Mint, Debian or any other Debian based distribution), we propose you a very simple alternative :
One of the major advantage of the code editor Mu, is two allow the display of the messages sent by CricuitPython thru the serial port. So typically, if there is an error in your code blocking the execution on the machine, CircuitPython will return the error description and the number of the line where the error occured.
On Linux, it is very easy to display the trafic on the serial port on a simple command terminal.
dmesg | grep tty
The result of the command should display a list of all available ports.screen
.screen -v
.sudo apt install screen
.screen /dev/ttyACM0 115200
(replacing ttyACM0 by the port's name you identified for your Gamebuino if it's different), and the output of the serial port will show up. So from now on if there is an error if the code, it will be displayed in this terminal :).You're all set to get started !
Everything is ready for you to start learning Python with your Gamebuino. Let's do it!