How can I display variables on an LCD screen using printLCD(lcd,) ?
Mostrar comentarios más antiguos
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 comentarios
Lars Kilian
el 11 de Mzo. de 2023
have you solved the problem ?
Walter Roberson
el 11 de Mzo. de 2023
printLCD(lcd, num2str(x))
Lars Kilian
el 12 de Mzo. de 2023
thanks this works !
Izza
el 3 de Dic. de 2023
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?
Respuestas (2)
Shadaab Siddiqie
el 29 de Abr. de 2021
0 votos
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 comentario
Walter Roberson
el 11 de Mzo. de 2023
At least in the current version at https://www.mathworks.com/help/supportpkg/arduinoio/ug/add-lcd-library.html the code is
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
el 9 de Jun. de 2022
0 votos
Hello Friends I need a help to display t=0, 'speed'= 0 in LCD display in same row Arduino board.
1 comentario
Walter Roberson
el 11 de Mzo. de 2023
t = 0; speed = 0;
msg = sprintf('t=%.1f, speed=%.1f', t, speed);
printLCD(lcd, msg);
Watch out for the 16 character limit.
Categorías
Más información sobre Arduino Hardware en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!