LPC1769 with EA baseboard Oled

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1769 with EA baseboard Oled

1,250件の閲覧回数
e0310751
Contributor I

I am working on the Oled (SPI) on EABaseboard with LCP1769 processor and the accelerometer(I2C).

My task is to display the x, y, z reading from the accel onto the oled screen.

I am able to display all I wanted on the screen, but there is a slight problem.

The accel reading takes up 3 spacing max on the screen.

Whenever the reading change from for eg, 159 to 19, the screen will show 199 instead of 19.

The last digit of 159 is not erased after the refresh.

It might be the issue of the definition of the variables but I can't seem to figure out the root of the problem

pastedImage_1.png

Please try to ignore my bad syntax or style of coding...

Thank you for your enlightenment.

ラベル(2)
タグ(3)
0 件の賞賛
返信
1 返信

1,032件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Wang,

This is my suggestion, I am not sure whether it is helpful.

Can you use the line?

sprintf(display_accx,"x-axis:%3d",*xc);

you define the variable width with 3.

BR

XiangJun Rong

0 件の賞賛
返信