Skip to content
Snippets Groups Projects
Commit 7a9605a2 authored by Lila Fisch's avatar Lila Fisch
Browse files

add led blink tutorial

parent c5570f02
No related branches found
No related tags found
No related merge requests found
Pipeline #2217 passed
......@@ -12,6 +12,7 @@ You need:
<!-- usb-A to usb-C and usb-C to usb-C photo would be helpful here -->
- an application for opening a serial connection, e.g. screen (installation via command line:`apt install screen`) or picocom (installation via command line: `apt install picocom`)
### Getting to the interactive python command line
Switch on your card10.
If your card10 display shows the text _USB activated._ your card10 is in the _USB storage_ mode, which is the wrong mode for the interactive pythong command line. A brief press on the _power_ button will exit the _USB storage_ mode.
<!-- a picture here, indicating the right button would be nice -->
......@@ -22,10 +23,29 @@ You can find out what it is called on your machine by comparing the output of `l
Depending on which tool you chose, you can open the interactive python command line
- using screen: `screen /dev/ttyACM0 115200`
- using picocom: `picocom -b 115200 /dev/ttyACM0`
You might need to add "sudo" in front of the commands.
If you don't see a line starting with _>>>_, try pressing _Ctrl+C_.
<div class="p-notification--information">
<p class="p-notification__response">
<span class="p-notification__status">Note:</span>The first line gives you the version of your firmware, e.g. "MicroPython v1.11-37-g62f004ba4 on 2019-08-17; card10 with max32666".
</p>
</div>
Once you have a line starting with _>>>_, you are ready to start programming in python!
### Making an LED blink
There are some neat python functions prepared for making the leds blink. Let's import the library containing these functions by typing:
```import leds```
Next, we light up one of the r0kets by typing:
```leds.set_rocket(0, 100)```
The first number entered is the index for selecting the r0ket LED. You can choose between 0 and 2.
## Using card10 in USB storage mode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment