Hi geektimes. I first read about BBC Micro computers here, on geektimes. Back in the 80s, the British company BBC launched a training project whose goal was to increase the level of computer literacy. Read more in the article of the company Plarium "
BBC Micro - a computer that beat the ZX Spectrum ", but we will return to today's affairs. Whether long, shortly, the BBC decided to repeat the project already on a modern element base, and released the
BBC Micro microcomputer
: bit .
As you can see, the modern model is slightly smaller
than its
predecessor .
About Micro: bit has already been written to geektimes, both about the fact that the board
can already be bought , and about the fact that it is even
distributed to British students for
free . However, there are few people who programmed it on the site, it’s time to fill this gap.
How it works, details under the cut.
Why do you need it
There may be a reasonable question "why is this necessary," given the variety of different devices, from Arduino to ESP32 or Raspberry Pi. Here the answer is simple.
1) For schoolchildren (British) it’s free, and the gift horse, as you know ... The board certainly has drawbacks - there are not enough LEDs in the matrix (and not colored), I would like a couple more power transistors to control the loads, but again, we’ll see . For all the rest, by the way, the issue price is about 20 Euro per amazon or ebay.
2) These boards are also officially delivered to schools for computer science lessons - it is much more interesting for children to study computer science on real devices (for example, write code to check the humidity in a flower and actually hang this thing on a flower) than just doing something abstract.
3) The board is focused on children from 7 years old - the same Arduino would be complicated, because without external devices, it is useless, but here what is needed is more than enough built-in capabilities. And for circles and those who want to do something more complicated, there are expansion cards, which will be discussed below.
4) The built-in functions of the board - bluetooth, compass, accelerometer, serial-port, the ability to work with I2C / SPI / sound / analog inputs, is enough to cover 99% of the needs of the computer science lesson, not to mention such “fashionable” directions as “smart” home ”or wearable devices (the board can connect to a smartphone, measure temperature and light, read data from external devices, etc.). There is clearly room for creativity here.
In general, the project is very interesting, and you can sincerely be glad that in Britain they do this for their children. By the way, it can be programmed using a visual-block programming language, in javascript or using Python (purely for reference, Russian schools are still taught in Turbo Pascal, but we will not talk about a sad
policy ). If desired, in Micro: bit you can
collect and fill in mbed os and write in C ++, but this is unlikely for schoolchildren.
Iron
The appearance of the board is clearly visible in the block diagram:
“Onboard” is an ARM Cortex-M0 processor, 256KB Flash ROM, 16KB RAM, 16 MHz clock frequency. There is also support for BTLE, a 2.4GHz transmitter for peer-to-peer communication (channel 101), an accelerometer, a compass, a thermometer, and a GPIO pin line, including quite a lot:
There are also 2 input buttons (the “shaking” gesture is available for input), a 5x5 LED matrix, and 4 “large” pins designed for the child to fasten something simple with wires or “crocodiles”, such as a humidity sensor for a flower or variable resistor.
The comb of pins is made flat, so that it can be inserted into the expansion board (issue price of 10-15 Euros):
There are different expansion cards, for example, a motor control board, which allows you to make such a robot:
However, only the battery compartment comes bundled with the board, all other modules are purchased separately. However, even in standard equipment, the board can quite a lot.
Soft
The first thing that surprised me is that no software should be installed on the computer at all. When the microUSB board is connected, it is simply visible as a removable disk. Then just go to
http://microbit.org/code/ and choose what you want to write on -
Javascript or
Python .
The Javascript editor in “block” mode opens directly in the browser and looks like this:
Here I wrote a small program that simply increments the counter by pressing a button, and by pressing 2 buttons it resets it to 0.
In general, a child may not know what Javasdcript is, but if you want, you can switch to a “full-fledged” editor in
god mode :
Next, just click “Download”, a hex file will be compiled, which you simply save to the microbit “disk” - the program will be loaded into flash memory and launched. Even if there is no board, right in the browser there is a full-fledged simulator in which you can test all the functions of the program.
As a ready-made "blocks" for the student, many different functions are available: from simple input-output to sound reproduction or servo-machine control. I combined part of the blocks in one screenshot, and this is not all:
If we talk about Python, the editor is very simple, and of course, does not reach PyCharm, but you can write simple code:
Alas, neither error checking nor good syntax highlighting is not here. The editor is even more primitive than the Arduino IDE (or I really did not understand). If there is an error in the code, the editor will not show it anywhere, the script will load “as is”, there is no console for debugging either (although you need to check if the serial port is not supported when debugging). Finally, there is no simulator either. It seems that the editor did "to the heap", the block editor seems to be considered the main one for development (and maybe they will finish it, the board only began to go to schools). However, the language itself with additional libraries is quite functional, the API can be viewed on
microbit-micropython.readthedocs.io/en/latest .
It is interesting to note that the battery pack comes bundled with the board, and you can create and load programs from an iOS or Android tablet. Theoretically, Micro: bit can be used without having a computer or even an electrical outlet. This was probably done for developing countries, for example in India the number of poor families with a smartphone or tablet instead of a PC is quite large.
Conclusion
We can assume that the idea of ​​the BBC is quite good. One can only be glad that in the UK they are trying to do something new and modern for children.
Examples of various educational projects for Micro: bit can be found
here .
From the point of view of programming "for adults", the board is, of course, somewhat boring. A set of I / O ports is sufficient, but the editor is very simple, and even without an adapter, using pins is not very convenient. But you have to understand that the target audience of the board is children from 7 years old, and to do something interesting just for such an audience is quite an interesting challenge.
There is an idea to make a number of video lessons with simple programs for schoolchildren, but there are doubts whether it is necessary for someone in Runet (there are quite a few such video tutorials in the English youtube).
As a bonus to those who read to here, for those who want to see the board "live", I posted a
small video . The second
part of the video shows an example of the program in the visual language and in the Python language, the
third part tells about the use of an accelerometer.