1678 views|0 replies

1w

Posts

25

Resources
The OP
 

[SAMR21 New Gameplay] 12. Driving OLED [Copy link]

 
This post was last edited by dcexpert on 2019-10-6 20:19

We have introduced some basic methods of MakeCode graphical programming before. Now we will introduce methods of OLED, sensors, etc.


This example requires an I2C interfaced 128x64 resolution OLED module and connects the SDA/SCL to the SAMR21.

Connection method:

SDA:PA22

SCL:PA23

First, click the gear icon in the upper right corner of the programming interface and select Extensions in the pop-up drop-down menu.

After entering, an extension selection interface will be displayed. There is an input box on the interface where you can enter the extension name or address to quickly search for the required extension.

In the extension input box, enter the following URL and press Enter or click the search icon:
https://github.com/makecode-extensions/OLED12864_I2C_V2

After the search is successful, the OLED extension will be displayed (this process requires an Internet connection)

Click the OLED extension to add the extension to MakeCode and display the OLED module in the graphical module.

Using this extension, you can easily drive OLED to display text, numbers, dots, lines, rectangles, etc. There are two ways to display text: print and show string. The difference between them is that show string displays text at a specified position, while print simulates the printing method of the console, displaying text after the last displayed position and automatically wrapping.

The following program displays an increasing number every second and automatically wraps the line.


This content is originally created by dcexpert , a user of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source

 
 

1w

Posts

25

Resources
2
 

image.png (1.13 MB, downloads: 0)

image.png
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list