1/14
Flashcards based on lecture notes about C/C++ CODAL programming for the micro:bit, covering hardware components, software tools, display functions, and image manipulation.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What command is used to build MICROBIT.hex after cloning the repository?
python3 build.py (or python build.py)
What is DAPLink?
Software for Arm Cortex CPUs that makes micro:bit appear as a USB drive when connected to a Windows PC.
What is the purpose of the MicroBit class?
Consists of variables and methods that operate as drivers to control commonly used features of the micro:bit.
What does 'uBit.init()' do in the 'Hello World!' example?
Initialises uBit, including the scheduler, memory allocator, and Bluetooth stack.
What does 'uBit.display.scroll("HELLO WORLD!")' do?
Scrolls "HELLO WORLD!" across the 5x5 display of uBit.
What is the difference between the 'scroll' and 'print' functions in the MicroBitDisplay class?
Scroll scrolls a string pixel by pixel, while print shows the letters of a string in turn on the screen.
How can the speed of scrolling/printing be adjusted using 'uBit.display'?
By specifying a delay value (the lower the value, the faster the message will be scrolled/printed).
What are the available display modes for the MicroBitDisplay class?
DISPLAYMODEBLACKANDWHITE, DISPLAYMODEBLACKANDWHITELIGHTSENSE, and DISPLAYMODEGREYSCALE
How do you set the brightness in DISPLAYMODEBLACKANDWHITE?
uBit.display.setBrightness(value between 1 and 255)
How do you set a pixel value in the MicroBitDisplay class?
uBit.display.image.setPixelValue(x, y, brightness)
How does the MicroBitImage class represent a bitmap picture?
As a managed type where a string constructor takes comma-separated values representing pixel brightness from 0-255 with newline characters \n indicating new lines.
What does 'uBit.display.print(smiley)' do in the MicroBitImage example?
Prints the MicroBitImage named smiley on the display.
What is the purpose of 'myImage.paste(cross, 1, 1)' in the MicroBitImage class?
Pastes the content of the MicroBitImage cross onto myImage at pixel coordinates (1, 1).
How can a constant array of unsigned integers be used to store a read-only picture for the micro:bit?
By creating a MicroBitImage with a constructor that takes the dimensions and the array as arguments, allowing a bitmap representation based on the provided buffer.
What code is used to clear the micro:bit screen?
uBit.display.clear()