MicroBlocks NEW Features #2 - TFT Library Support
This one will be of great interest to PicoBricks Users. It is available in the Pilot release 1.2.20 FW 188 now, and will be in the next stable release, early next week.
As you know, the OLED Graphics Library is the one you have been using for displaying anything on the OLED display. However, with all it's great features like buffered compositions, animations, wrap control, sprites, etc, it exacts a heavy memory toll on your projects at 26K.
To lighten up the memory footprint at the expense of a some features, we are now supporting display capability using the TFT Library. With only a 3K size, it is the perfect tool for projects that do not need all the fancy capabilities of the OLED Graphics Library.
You can display simple geometric shapes and write text. You get the benefit of full set of 256 ASCII characters, as opposed to the 96 character set of the OLED Library. Text can be scaled from 1 to 21, allowing you to highlight parts of your information display.
While the TFT Library blocks support full color range of various displays, the OLED display being black & white, there are only two options: black or any other color value displayed as white.
To assist with display refresh issues, there are two new blocks: defer and resume TFT display updates. These allow the user to print something to the display without actually showing it on the screen, until the resume block is executed.
We have provided an example program (PicoBricks Test) in the File / Open / Other / Examples menu, to help anyone start to experiment with the Library. It will display some of the sensor values of the PicoBricks kit.
In the example program, we are using the defer feature to collect all four sensor values, right-justify them, and write them, before resuming the display updates and actually displaying the end result.
NOTES:
- If you have any projects written to work with the original OLED Graphics Library, and you want them to work with the TFT Library, you will need to modify your code to use the TFT Library blocks. Your old code will not function automatically with the new library.
- The two Libraries have their own respective buffers. While it is technically possible to engage both of them, you will not be able to combine the display buffers from the two different libraries. However, you can use them in the same project one at a time, paying attention to which one has control of the display.
Enjoy.
Comments
-
Made a Tweet about this and posted it on the MicroBlocks Discord server. This is great.
1 -
as I am new to this I have 2 questions...
1) is there a picobricks temperature (F) instead of (c)
2) where is Gods name is the display command that you can enter 'display picobricks humidity line 4
I have looked in all the libs and could not find a display command where you can enter a variable.
Thanks,
Roy
1 -
Hi Roy,
Welcome to MicroBlocks and Picobricks.
The light blue DISPLAY block is a user coded function that can be found under My Blocks selection on the left side menu.
It was coded to make it easier to right-justify the output. I have included the code below.
As far as the Fahrenheit display goes, you can do the math conversion using formula: °F = (9/5) * °C + 32
Since MicroBlocks is an Integer math environment, the calculations will lack a certain level of precision. To compensate for that, I am presenting two versions of the formula:
- one with integer math, without decimal positions
- one with a single decimal position accuracy. ( Achieved by first multiplying the TEMP by 90 and then adding 320)
Both scripts are below:
Enjoy.
1
Howdy, Stranger!
Categories
- 117 All Categories
- 3 Community
- 3 Hello Maker!
- 102 PicoBricks - Make, Run, Split, Merge
- 1 PicoBricks IDE
- 1 Arduino IDE
- 31 Hardware Support
- 15 PicoBricks Backers Hub
- 49 MicroBlocks Support
- 3 Shipping Support
- 2 MicroPython
- REX - 8 in 1
- Mechanical Parts and Parkour
- REX Main
- Arduino-IDE
- REX - Shipping
- 12 Products & Technology
- 2 Raspberry Pi
- Arduino
- 10 Other