Main Content

displayMessage

Scrolls a text message across the LED Matrix

Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.

Description

displayMessage(mysh,Message,Name,Value) displays a scrolling message from right to left across the LED Matrix at the specified orientation, scrolling speed, text color, and background color.

example

Examples

collapse all

You can display the message ‘Hello World’ applying the following arguments.

displayMessage(mysh,'Hello World') 

Displays the message ‘Hello World’ on the LED Matrix as a scrolling text. The text scrolls at a speed of 0.1 second, the text color is red, and background color is black.

displayMessage(mysh,'Hello World','Orientation',90) 

Displays the message ‘Hello World’ on the LED Matrix as a scrolling text. The text is now oriented at 90 degrees.

displayMessage(mysh,'Hello World','ScrollingSpeed',0.05) 

Displays the message ‘Hello World’ on the LED Matrix as a scrolling text with the specified scrolling speed of 0.05 seconds.

displayMessage(mysh,'Hello World','TextColor','w') 
or 
displayMessage(mysh,'Hello World','TextColor',[255 255 255])  

Displays the message ‘Hello World’ on the LED Matrix as a scrolling text. The color of the text is now set to the specified color ‘white’.

displayMessage(mysh,'Hello World','BackgroundColor','w') 
or 
displayMessage(mysh,'Hello World','BackgroundColor',[255 0 0])   

Displays the message ‘Hello World’ on the LED Matrix as a scrolling text. The background color is now set to the specified color ‘white’.

displayMessage(mysh,'Hello World','Orientation',90,'ScrollingSpeed',0.05,'TextColor','w','BackgroundColor','r') 

Displays the message ‘Hello World’ on the LED Matrix as a scrolling text with the specified orientation, scrolling speed, text color, and the background color.

Input Arguments

collapse all

Connection to a SenseHAT board, specified as a sensehat object.

The Scrolling message to be displayed from right to left at the specified speed, color, and the background color. Message can be specified as a string.

Example: Msg = ‘Do you speak MATLAB?’

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: displayMessage(mysh,'Hello World','Orientation',90)

The orientation to applied for the message to be displayed. The supported values of orientation are 0, 90, 180, and 270.

Example: 90

The speed at which the message should scroll from right to left.

Example: 0.05

The color in which the scrolling message should be displayed.

You can specify the following colors by name:

  • ‘red’ or ‘r’

  • ‘blue’ or ‘b’

  • ‘green’ or ‘g’

  • ‘cyan’ or ‘c’

  • ‘magenta’ or ‘m’

  • ‘yellow’ or ‘y’

  • ‘white’ or ‘w’

  • ‘black’ or ‘k’

Example: [255 255 255]

The background color with which the scrolling message should be displayed.

You can specify the following colors by name:

  • ‘red’ or ‘r’

  • ‘blue’ or ‘b’

  • ‘green’ or ‘g’

  • ‘cyan’ or ‘c’

  • ‘magenta’ or ‘m’

  • ‘yellow’ or ‘y’

  • ‘white’ or ‘w’

  • ‘black’ or ‘k’

Example: [255 0 0]

Version History

Introduced in R2016b