LED screen

The BBC micro:bit LED screen consists of 25 red LED lights arranged in a 5X5 grid (5 LEDs across by 5 LEDs down).

BBC micro:bit su visais 25 šviečiančiais LED'ais

 

Kurios LED?

Naudokite x, y koordinates, kad nurodyti konkrečios LED vietą tinklelyje. Kur x yra horizontalioje padėtyje, o y yra vertikalioje padėtyje (0, 1, 2, 3, 4). Kad išsiaiškinti x, y koordinates, būtina tinkamai nustatyto Jūsų micro:bit įrenginio pozicija į horizontalią, pvz., kredito kortelės (žr. nuotrauką aukščiau).

Tai yra konkretaus LED x, y koordinatės nurodytos 5 X 5 tinklelyje:

0, 0 1, 0 2, 0 3, 0 4, 0

0, 1 1, 1 2, 1 3, 1 4, 1

0, 2 1, 2 2, 2 3, 2 4, 2

0, 3 1, 3 2, 3 3, 3 4, 3

0, 4 1, 4 2, 4 3, 4 4, 4

The x, y coordinates for the LED in the centre of the grid are 2, 2. Starting from 0, 0 count over 2 columns and then down 2 rows.

Eilutė, stulpelis - 1

Since the row and column numbers start at 0, an easy way to figure out the x, y coordinates is to subtract 1 from the row and column number (when counting from 1). In other words, to specify the LED in the 4th column 5th row, subtract 1 from each number to get coordinates 3, 4.

Coding the LEDs

MakeCode redaktorius

Turning a LED on/off

Use plot and unplot to turn an LED on or off.

Ar LED įjungtas, ar išjungtas?

Use the point function to find out if a LED is on or off.

Rodyti paveiksliukus, eilutes ir numerius

Instead of turning individual LEDs on or off, as above, you can display an image directly to the screen or show text/numbers on screen using the show number/show string function.

Python

See the images section of the documentation to learn more about programming the LEDs in Python for micro:bit.

Selecting this opens external content from our support system, which adheres to their privacy policy.