Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
Added new sinobit.display.text and sinobit.display.text_width functions that draw text on the full 12x12 sinobit display using the Zpix font. This font covers a wide range of Unicode characters and the firmware includes support for the Latin 1 (0x20-0x7F) and Latin 1 supplement (0xA0-0xFF) characters which cover Latin characters with accents. See the examples/scroll.py demo for a demo of the usage.
Two small fixes to the micro:bit display drawing. The first is to re-orient the display so it draws with the origin (upper left) in the same position as the sino:bit display. This makes micro:bit code render with the 'up' side of the board being the USB connector and the buttons on the left and right. It looks like the buttons are physically swapped between the two boards though so a future update might consider the option of re-orienting the display or swapping button behavior.
The second fix was to re-enable exception printing on the display. If a script saved to main.py fails to run and throws an exception it will now scroll across the display just like with the micro:bit.
This release adds support for the microbit.display module! This means code written to write to the micro:bit display will 'just work' on the sino:bit. The micro:bit has a 5x5 LED matrix whereas the sino:bit has a larger 12x12 LED matrix. To make the display module work it will upsample each of the 5x5 micro:bit LEDs to light 2x2 blocks of sino:bit LEDs. An unused 1 pixel frame will surround the sino:bit display.
One important difference with the microbit.display module support is that it does not support per-pixel brightness settings. Since the sino:bit hardware doesn't support individual LED brightness levels any attempt to set a non-zero pixel brightness will instead result in fully bright pixels. In practice this is likely not a major limitation.
With this release try running micro:bit example code in the examples/microbit folder of this repository. For example the magic8.py script will scroll a magic 8 ball message when the accelerometer detects a shake. Or the counter.py script will count how many times the A button is pressed and scroll it across the display. A simple demo of scrolling a message from the Python terminal/REPL would be:
from microbit import display display.scroll("Hello world!")
Note that since this is using the microbit module it only supports English text--future releases will hopefully add proper Chinese and Asian language support in the sinobit module!
See the previous release for mention of using the ampy tool to copy a script to the board as a main.py that runs at boot too: https://github.com/tdicola/sinobit-micropython/releases/tag/0.0.1
Initial release with basic pixel drawing support for the sino:bit's 12x12 matrix. This MicroPython port is functionally equivalent to the BBC micro:bit port but with the following differences:
- The microbit module display class is disabled. Do not try to use its drawing functions, they do nothing at the moment.
- A new sinobit module is added. This will be the base for sino:bit-specific hardware going forward and includes a new display submodule. The sinobit.display submodule supports drawing to the sinobit's 12x12 LED display with basic pixel set and fill commands.
- The platform and other names are changed from microbit to sinobit.
Attached is a sinobit-micropython-0.0.1.hex file you can drag to your sino:bit's MICROBIT drive to program it with this MicroPython firmware. Be sure your sino:bit is powered well (plug in an external battery just in case) to ensure it successfully flashes the firmware. Once flashed you can access the Python REPL / terminal just like any other MicroPython board through the serial port the sino:bit creates. On Windows you might need to install a serial driver as mentioned here: https://learn.adafruit.com/micropython-basics-how-to-load-micropython-on-a-board/bbc-microbit#windows-cdc-serial-driver-install
The attached arc_reactor.py script is a demo of drawing to the display. You can load it using the ampy tool described here: https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy Save the arc_reactor.py as a main.py file on the sinobit and it will run automatically at start. For example if you download arc_reactor.py to a directory and run the following ampy command from within that directory (being careful to change the path or name of the serial port that the sinobit shows up as too):
ampy --port /path/to/sinobit/serial/port put arc_reactor.py main.py