Display and LED
This section contains all of Misty's APIs related to changing the display and LED.
DisplayImage
Displays an image on Misty's screen. You can use this command to display images from Misty's local storage or to display images that are hosted on the web.
Example Code
Misty uses the default image layer settings the first time she draws content with the DisplayImage
command. You can use the SetImageDisplaySettings
command to adjust the settings and change the appearance for a specific image layer. Issuing a SetImageDisplaySettings
command redraws the updated image layer on Misty's display.
Parameters
FileName (string) - Filename for the image to display. Valid image file types are
.jpg
,.jpeg
,.gif
,.png
. Alternately, ifIsUrl
is true, the URL path for the image to display.Alpha (double) - Optional. Opacity for the layer on which the image displays. A value of 0 is completely transparent; 1 is completely opaque. When you specify a value greater than 0 and less than 1, the layer appears but is transparent. Defaults to 1.
Layer (string) - Optional. The display layer to create or update with this command. If
null
or not supplied, the image displays on the default image layer (namedDefaultImageLayer
).IsUrl (boolean) - Optional. If
true
, the system treats the string you pass in forFileName
as the URL address for an image hosted online.
DisplayText
Misty uses the default text layer settings the first time she draws content with the DisplayText
command. You can use the SetTextDisplaySettings
command to adjust the settings and change the appearance for a specific text layer. Issuing a SetTextDisplaySettings
command redraws the updated image layer on Misty's display.
Example Code
Parameters
Text (string) - The text to display.
Layer (string) - Optional. The layer on which to display the text. You can use this parameter to create a new text layer or to update an existing text layer. If not supplied, the text displays on the default text layer (named
DefaultTextLayer
).
DisplayVideo
Plays a video on Misty's screen.You can use this command to play videos you upload to Misty or videos that are hosted on the web. Use the SaveVideo
command to upload a new video asset to your robot.
Example Code
Misty uses the default video layer settings the first time she draws content with the DisplayVideo
command. You can use the SetVideoDisplaySettings
command to adjust the settings and change the appearance for a specific video layer. Issuing a SetVideoDisplaySettings
command redraws the updated video layer on Misty's display.
The DisplayVideo
command has the following limitations at this time:
You cannot use the
DisplayVideo
command to play video recordings that Misty creates with theStartRecordingVideo
command. Misty can only play user-uploaded videos on her display.Misty does not play audio for the videos she plays on her display.
Parameters
FileName (string) - Filename for the video to play, with the file type extension. Valid video file types are .
mp4
and.wmv
. Alternatively, ifIsURL
istrue
, the URL path for the video to play.Layer (string) - Optional. The display layer to create or update with this command. If
null
or not supplied, the video plays on the default video layer (namedDefaultVideoLayer
).IsUrl (boolean) - Optional. If
true
, the system treats the string you pass in forFileName
as the URL address for a video hosted online.
DisplayWebView
Misty uses the default webview layer settings the first time she draws content with the DisplayWebView
command. You can use the SetWebViewDisplaySettings
command to adjust the settings and change the appearance for a specific webview layer. Issuing a SetWebViewDisplaySettings
command redraws the updated webview layer on Misty's display.
Example Code
Important! Displaying webviews can consume a lot of computational resources. If you notice Misty's performance decrease while multiple webviews layers are active, you may consider deleting one or more webview layers.
Parameters
URL (string) - The URL for the web page to display.
Layer (string) - Optional. The display layer to create or update with this command. If
null
or not supplied, the webview displays on the default webview layer (namedDefaultWebViewLayer
).
ChangeLED
Changes the color of the LED light behind the logo on Misty's torso.
Example Code
Parameters
Red (byte) - The red RGB color value (range 0 to 255).
Green (byte) - The green RGB color value (range 0 to 255).
Blue (byte) - The blue RGB color value (range 0 to 255).
TransitionLED
Sets Misty's LED to transition between two colors. When you use this command, Misty will continue the transition you specify until she is powered off or receives another command to change or transition her LED.
Example Code
Parameters
Red (byte) - The red RGB color value for the first color (range 0 to 255).
Green (byte) - The green RGB color value for the first color (range 0 to 255).
Blue (byte) - The blue RGB color value for the first color (range 0 to 255).
Red2 (byte) - The red RGB color value for the second color (range 0 to 255).
Green2 (byte) - The green RGB color value for the first color (range 0 to 255).
Blue2 (byte) - The blue RGB color value for the first color (range 0 to 255).
TransitionType (string) - The transition type to use. Case sensitive. Accepts
Blink
(continuously blinks LED between the specified colors),Breathe
(continuously fades LED between the specified colors), andTransitOnce
(blinks LED from first color to second color only once).TimeMs (int) - The duration (in milliseconds) between each transition. Must be greater than
3
.
Last updated