Member-only story
MicroPython Tutorial VII
We have charged ahead in the last few tutorials and I thought this might be a good place to take stock. As I said in last tutorial you covered buttons, LEDs, sounds and images.
Lets take a few moments to review. The buttons we already named in the first tutorial. Here is reminder. You got 10 choices.
LEFT_DOWN
DOWN
RIGHT_DOWN
LEFT
CENTER
RIGHT
LEFT_UP
UP
BEACON
RIGHT_UP
Moving ahead beyond buttons, we talked about color, now in LEDs we have just four colors, although in honestly there are very few defined in MicroPython anyway. Here is a complete list for future reference, you can use all the colours with the colour sensor.
Color.BLACK,
Color.BLUE,
Color.GREEN,
Color.YELLOW,
Color.RED,
Color.WHITE,
Color.BROWN or
None
We picked sounds from a collection that downloads with the ev3dev brickman image. You can find the complete list by using the command “ls -lR /usr/share/sounds” obviously when you logged into the brick. At the time of writing I find these files.
robot@lima:~$ ls -lR /usr/share/sounds
/usr/share/sounds:
total 8
drwxr-xr-x 2 root root 4096 Mar 4 03:42 alsa
drwxr-xr-x 11 root root 4096 Mar 4 03:51 ev3dev/usr/share/sounds/alsa:
total 1212
-rw-r--r-- 1 root root 137134 Jan 23 2017 Front_Center.wav
-rw-r--r-- 1 root root 142128 Jan 23 2017 Front_Left.wav
-rw-r--r-- 1 root root 146990 Jan 23 2017 Front_Right.wav
-rw-r--r-- 1 root root 135202 Jan 23 2017 Noise.wav
-rw-r--r-- 1 root root 130096…