Table of Contents

showanimation()

Function Definition: showanimation(animation = "happy")

Parameters

NameTypeDescriptionExpected ValuesDefault Value
animationstringThe animation which needs to be played."happy", "nerdy", "thinking", "angry", "contempt", "blink", "fear", "surprise", "wink", "wave", and "crying""happy"

Description

The function sets the RGB LED display matrix to display the animation specified: “happy”, “nerdy”, “thinking”, “angry”, “contempt”, “blink”, “fear”, “surprise”, “wink”, “wave”, and “crying”.

Example

The example demonstrates the various animation of the Quarky LED display in the Python Coding Environment.

Code

sprite = Sprite('Tobi')
quarky = Quarky()
import time

quarky.showanimation('happy')
quarky.showanimation('happy')

quarky.showanimation('nerdy')
quarky.showanimation('nerdy')

quarky.showanimation('thinking')
quarky.showanimation('thinking')

quarky.showanimation('angry')
quarky.showanimation('angry')

quarky.showanimation('contempt')
quarky.showanimation('contempt')

quarky.showanimation('blink')
quarky.showanimation('blink')

quarky.showanimation('fear')
quarky.showanimation('fear')

quarky.showanimation('surprise')
quarky.showanimation('surprise')

quarky.showanimation('wink')
quarky.showanimation('wink')

quarky.showanimation('wave')
quarky.showanimation('wave')

quarky.showanimation('crying')
quarky.showanimation('crying')

Output

Read More
The example demonstrates how to display scrolling text to make a name badge in the Python Coding Environment.

Code

sprite = Sprite('Tobi')
quarky=Quarky()

while True:
	quarky.showanimation("blink")
	quarky.showanimation("blink")
	quarky.showscrollingtext("Quarky", 2, [0, 255, 0])
	quarky.showscrollingtext("Robotics", 2, [0, 0, 255])

Output

Read More
All articles loaded
No more articles to load