Display time!

Display time!

Your first sketch was successfully coded.

Are you ready for more?

We'll now see what we can do with the display.

While working on the display, we will mostly use the display block section.

In this task, we will try to write on CircuitPet's display. A good thing to know is that if you have to write something on your display, firstly, you will have to set the font size, font type, and font color. 


So, let's start! 

Let's look for the font size block that looks like this:

random image

You can make your letters whatever size you want.

random image

Now, let's set the font type

It's in the same block section as the previous one.

random image

This is what your code should look like by now: 

random image

The last thing we have to determine is the font color

random image

We chose navy for the font color, but you can use any color from the color palette.

random image

Let's make the main part of this sketch - write a sentence (or a word) you want to print on display.

To do that, you'll have to use this block:

random image

As you can see, there are three white circles used for writing. 

The first one, next to print, determines the sentence that will appear on display.

The "x" and "y" mark coordinates where the text will appear on display.

We decided to write "Hello, world!" on the screen, but we kept the coordinates.  

random image

The last thing you need to do in this sketch is click on a "draw sprite to display" block.

We need to use this block to ensure this code will appear on display.

random image

random image

Hit the big red Run button and wait for the code to compile!