Table of Contents: |
|
What does it do?
The OD01 is a 64x128 pixel monochrome OLED display. Use it to:
- print strings and numbers: show sensor readings / diagnostics
- draw lines and boxes
- design user interfaces and simple animations / effects
Its great for learning the basics of print and animation and it has all the power you need to build visual interfaces for your digital instruments:
Some examples of what you can show on the OD01 display
Loading the MakeCode extension:
To write code for the OD01 in MakeCode you will need to load the OD01 extension:
- Open MakeCode and start a new project
- Click on Extensions
- Type in XinaBox
- Click on search
- Select the OD01 tile
Hello world:
One of the most simple programs you can write with the OD01 is to display Hello World! on screen. As long as you've imported the OD01 you can use the code below:
Remember to attach your OD01 to your micro:bit before running the code.
How-to Guides:
- Connecting it up
- Loading the extension and Hello World!
- Basic print techniques
- How to draw lines
- Using the color parameter
- Inverting the screen
- An introduction to using pixels
- Simple animation
- Moving a rectangle with the A and B buttons
It is often useful to show a scale - a visual way of displaying a value. We've built a reusable scale that you can drop into your projects to enrich your OD01 displays:
The scale looks like this: |
The scale is called like this: |
You can find the code used for the scale here. Use this code base to build your project then use the drawScale function to insert a scale.
Another useful graphic that you might want to use are arrows that point in the cardinal directions:
You can find the code for these arrows in this MakeCode project. There are four functions: drawUp, drawDown, drawLeft, drawRight. Copy these into your program and edit as needed (e.g. you could remove the labels or replace them with North, East, South and West).