displayMessage

Scrolls a text message across the LED Matrix

Description

example

displayMessage(mysh,Message,Orientation,ScrollingSpeed,TextColor,BackgroundColor) displays a scrolling message from right to left across the LED Matrix at the specified orientation, scrolling speed, textcolor, and the background color.

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.

Example: Msg = ‘Do you speak MATLAB?’

The orientation to be 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 across the LED Matrix from right to left. This is the time paused between the transition of the text between adjacent columns.

Example: 0.1

The color in which the scrolling message should be displayed.

Example: [255 0 0]

The background color of the scrolling message on the LED Matrix.

Example: [255 255 255]

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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]

Introduced in R2016b