3888 views|8 replies

1942

Posts

2

Resources
The OP
 

[BearPi-HM Nano, play with Hongmeng's "touch and pay" function] Part 3: Is the OLED screen lit up? [Copy link]

1. Introduction

Prepare to make a small demo, communicate with the computer through UDP, and then display the data sent by the computer on the OLED screen. The official IIC routine is provided, so isn't this simple?

2. Design

Before briefly learning the [Hello World] and [LED] routines, you know how to create a Demo. First, implement an OLED Demo and create the required questions, as shown in Figure 1.

Figure 1

Then create the driver layer file.

Figure 2

Then start writing the program. First, we need to create a task to refresh the content of the OLED screen. This article does not use content refresh for the time being, but it will be used in the next article when cooperating with UDP. At that time, the message queue will be used to transmit the content to be displayed, thus combining LiteOS!

Figure 3

Then it is time to modify the driver layer. In fact, it is quite simple. The 51 MCU routines of the OLED screen are already packaged. You only need to modify the IIC communication layer. Figure 4 below shows the main modifications. There is a pit here that stuck me for nearly two hours. Let me share it here. First, after the program is compiled, the software [HiBurn] that downloads the program must re-import the BIN file to be downloaded; another thing is that when IIC assigns data, you cannot assign data to [sendBuf]. Instead, you need to create an array and assign the pointer of the array to [sendBuf]. [sendBuf] is a pointer, not an array! I hope that the friends who play IIC will pay attention to this!

Figure 4

Finally, it’s time to perfect the initialization procedure!

Figure 5

Just connect the screen to the IO00 and IO01 pins.

Figure 6

The final effect is shown in Figure 7.

Figure 7

3. Summary

The overall packaging of BearPi is very good, it is very convenient to call, and it is not difficult to develop. The next article is the combination of UDP and OLED screen. I hope you don’t miss it!

OLED screen source code: my_iic_oled.zip (8.41 KB, downloads: 43)

This post is from ARM Technology

Latest reply

I was just about to write about OLED, and the big guy has already written it.   Details Published on 2021-6-24 22:07
 

6587

Posts

0

Resources
2
 

Waiting to see the combination of UDP and OLED screen

This post is from ARM Technology

Comments

Good!  Details Published on 2021-6-10 08:32
 
 
 

1942

Posts

2

Resources
3
 
Jacktang posted on 2021-6-10 08:17 Waiting to see the combination of UDP and OLED screen by the host

Good!

This post is from ARM Technology
 
 
 

650

Posts

8

Resources
4
 

Like it, I will learn it when I have time.

This post is from ARM Technology
 
 
 

2549

Posts

0

Resources
5
 

Like this, I don't understand Hongmeng, follow me to learn

This post is from ARM Technology

Comments

Let’s learn together!  Details Published on 2021-6-11 08:35
 
 
 

1942

Posts

2

Resources
6
 
Digital Leaf published on 2021-6-10 20:48 Like this, if you don’t understand Hongmeng, follow and learn

Let’s learn together!

This post is from ARM Technology
 
 
 

7452

Posts

2

Resources
7
 

What about the match?

This post is from ARM Technology

Comments

What's the match?  Details Published on 2021-6-11 19:03
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

1942

Posts

2

Resources
8
 

What's the match?

This post is from ARM Technology
 
 
 

18

Posts

1

Resources
9
 

I was just about to write about OLED, and the big guy has already written it.

This post is from ARM Technology
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

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