フィルターのクリア

How can I display variables on an LCD screen using printLCD(lcd,) ?

28 ビュー (過去 30 日間)
Jonathon Staggs
Jonathon Staggs 2021 年 4 月 14 日
コメント済み: Izza 2023 年 12 月 3 日
I can display strings on my LCD using the matlab function printLCD(lcd,'Hello World') but I cannot define x = 123 and printLCD(lcd,x)
  4 件のコメント
Lars Kilian
Lars Kilian 2023 年 3 月 12 日
thanks this works !
Izza
Izza 2023 年 12 月 3 日
hello! this doesn't work for me for some reason, i tried printing x=123, but it printed a hashtag instead, could you help me out?

サインインしてコメントする。

回答 (2 件)

Shadaab Siddiqie
Shadaab Siddiqie 2021 年 4 月 29 日
From my understanding you are not able to run printLCD(lcd,123). This might be because second argument of the printLCD must be a string. you can refer create LCD add-on for more information.
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 3 月 11 日
function printLCD(obj,message)
cmdID = obj.LCD_PRINT;
if numel(message) > 16
error('Cannot print more than 16 characters')
end
With the error talking about characters it follows that message is expected to be a character vector, not a string() scalar.

サインインしてコメントする。


Pradeep Gopalsamy
Pradeep Gopalsamy 2022 年 6 月 9 日
Hello Friends I need a help to display t=0, 'speed'= 0 in LCD display in same row Arduino board.
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 3 月 11 日
t = 0; speed = 0;
msg = sprintf('t=%.1f, speed=%.1f', t, speed);
printLCD(lcd, msg);
Watch out for the 16 character limit.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by