PROGRAMMING SCHOOL
Programming micro:bit AD in Python
1. PROGRAMMING MANUAL9. micro:bit AD + micro:bit IO F5 - I2C communication (Python)
2. METEORI GAME (prog42.py)10. GRAPHIC FUNCTIONS IN APPLICATION - COMPASS (Python)
3. BASIC PLATFORM GAME (prog40.py)11. GAME - SIMPLE EXAMPLE (Python)
4. CREATING PLATFORMS (prog36.py)12. GRAPHICS FUNCTIONS (Python)
5. Silent Night13. GAME - METEORS (Python)
6. PHOTO SENSORS - VALUES DISPLAY (Python)14. GAME - LABIRINTH (Python)
7. PHOTO SENSOR - BAR GRAPH VALUES (Python)15. PLATFORM GAME (Python)
8. SWITCH STATUS (Python)16. TEXT FUNCTIONS (Python)

PROGRAMMING MANUAL
Opis_HR.jpg

In the first part of the instructions for programming the micro:bit AD BW interface, the initial steps are covered. Connecting and starting the interface, loading the library and all the basic functions (printing text, lines, circles, circles, rectangles, ...). The second part deals with how to use SCROLL functions. The third part contains all the graphical functions that can be used to create different games. The instructions are in PDF format and can be copied via the DOWNLOAD button on the preview (DOWN ARROW), or with ALL EXAMPLES OF PROGRAMS (plus EXCEL maps) via the link below.
( 3 Mb )

METEORI GAME (prog42.py)
27.jpg

Program example from the manual (prog42.py - page 34). Basic version of the METEORI program with all functions.

BASIC PLATFORM GAME (prog40.py)
26.jpg

Program example from the manual (prog40.py - page 30-31). Complete basic platform game.

CREATING PLATFORMS (prog36.py)
25.jpg

Program example from the manual (prog36.py - page 25). Creating game platforms.

Silent Night
24.jpg

Musical greeting card.

PHOTO SENSORS - VALUES DISPLAY (Python)
23.jpg

The display of the analog values of the read sensors can also be displayed in several ways. One is a display in text form.

PHOTO SENSOR - BAR GRAPH VALUES (Python)
22.jpg

The display of analog values of read sensors can be displayed in several graphical ways. The example shows the read values in the form of a 2D graph.

SWITCH STATUS (Python)
21.jpg

One way to display the status of a button or other sensor, with a digital value reading, is a text status display. It is also possible to display graphically.

micro:bit AD + micro:bit IO F5 - I2C communication (Python)
20.jpg

Micro:bit AD can be used to display values in combination with other interfaces that allow I2C (3.3V) communication. The interface shown is a micro:bit IO F5 that has a connector for I2C (3.3V) communication. The F5 interface simultaneously powers the micro:bit AD via the 5V power connector.

GRAPHIC FUNCTIONS IN APPLICATION - COMPASS (Python)
19.jpg

To display the data obtained from the compass, we used the functions to draw a circle, a filled circle, and a line.

GAME - SIMPLE EXAMPLE (Python)
16.jpg

This game does not use the scroll function to move objects. Objects are displayed on the screen and do not change position. Objects with functions that affect the player object are used. In addition to the previously displayed objects, a new object with the DOOR function is used. By passing through the DOOR, the player object appears at the starting position and the complete screen is displayed again. TOUCH sensors are also used for additional controls of the player object. Standard functions are used to draw lines. Other standard features for drawing or printing text can be used to create the screen.

GRAPHICS FUNCTIONS (Python)
15.jpg

The demo shows functions for drawing lines, circles, rectangles, pixels in combination with scroll functions. Scroll functions allow you to display data in GRAPH format or simple animation. Combinations of scroll functions with graphic objects can best be seen in demo examples of games.

GAME - METEORS (Python)
13.jpg

As in the previous game, it is necessary to define the appearance of the "screen" and the position of the objects on the screen. In this game we do not have platforms but objects that collide with the player's object (aircraft). In addition to objects with function (2,3), the game also uses an object that does not change the result of the game directly, but affects the position of the player's object.

GAME - LABIRINTH (Python)
12.jpg

A game that contains all the basic functions for making a game and all four directions of player object control. In previous games, sound effects appear in different situations in the game. Sound effects are used to gain points, loss of life and drop out off screen (loss of life). Sound effects can be created as desired.

PLATFORM GAME (Python)
11.jpg

When creating a platform game, it is necessary to define certain parameters of the game. In order for the game to be interesting, it is necessary to create graphic objects that have a certain function. In addition to the player object (9), it is necessary to create an object that will bring points to the player (2), and an object that will take the life (3). In platform games, it is necessary to create platforms on which the player's object moves. The OBJ function allows you to create one or more "screens" with the positions of different objects. The display of these "screens" on the screen is performed sequentially and in a circle. In addition to creating graphical objects (bitmaps), it is necessary to define the operation of functions that control the movement of the player's object. One of the functions is GRAVITY. Setting the gravity parameter to 1 turns on the function that controls the player's object to fall, if it is not on the platform. If the PAD (1) function is on, the player object reappears at the initial position after falling off the screen, and if the PAD is off, the player object will appear at the top position of the screen. In addition, if the game is to be scored, it is necessary to turn on the BOD function with the initial state (0). The LIV function is used to assign the initial number of lives. This is just a brief description of some of the features used in this demo game.

TEXT FUNCTIONS (Python)
10.jpg

The demo program shows the functions that work with printing and text control. The functions of printing text of different sizes in standard and graphic mode are shown. Standard mode uses text screen resolution (14x6) and graphical graphic resolution (84x48). In addition to printing, text manipulation functions are displayed.