Community Translation - Displaying a Float Value on LCD Using PSoC® 3 or PSoC 5LP – KBA94460

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi,               

I would like to translate KBA94460 into Japanese.

Please confirm to my work.

Thanks,

Kenshow

0 Likes
2 Replies
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi, Kenshow-san

Sorry that this candidate is wrongly added.

Would you consider to translate other one?

Below is new candidate.. If you'd like to take, please document a new thread.

Displaying a Floating Point Number

printf / scanf functions in Imagecraft compiler


Thanks

Jenna

Jenna Jo
0 Likes
Kenshow
Level 8
Level 8
Distributor - Marubun (Japan)
50 solutions authored 25 solutions authored 10 solutions authored

Hi Jenna-san,

                                

Japanese translation was over.
Please check below.

Original KBA:

Displaying a Float Value on LCD Using PSoC® 3 or PSoC 5LP – KBA94460

Thanks.

Kenshow

==============================

タイトル: PSoC®3またはPSoC 5LPを使用してLCDに浮動小数点値を表示 – KBA94460

バージョン:**

質問:

浮動小数点値をASCIIに変換し、PSoC 3またはPSoC 5LPを使用してPSoC CreatorLCDに表示するにはどうすればよいでしょうか?

回答:

LCDに浮動小数点値を表示するには、最初にsprintf関数を使用して浮動小数点値を文字列に変換する必要があります。

次のコードスニペットを使用して、LCDに浮動小数点値(たとえば-1.2345)を表示します。

#include <project.h>

#include <stdio.h>

int main(){ /* ここに初期化/起動コードを配置します(例:MyInst_Start()*/

      char tstr [16];

            float compValue = -1.2345;

            LCD_Start();

            LCD_Position(0,0);

            Sprint(tstr,"%+ 1.4f", compValue); // floatASCIIに変換し、char配列に格納します

            tstr LCD_PrintString(tstr);

            for(;;){  /* ここにアプリケーションコードを配置します */ }

}

==============================

1-Sept-2020

Kenshow

0 Likes