Table of Contents

showpattern()

Function Definition: showpattern(pattern = "rainbow")

Parameters

NameTypeDescriptionExpected ValuesDefault Value
patternstringThe pattern which needs to be played."rainbow", "rainbow strip", "cloud colors", "party colors", "forest colors", and "lava colors""rainbow"

Description

The function sets the RGB LED display matrix to display the specified pattern: “rainbow”, “rainbow strip”, “cloud colors”, “party colors”, “forest colors”, and “lava colors”.

Example

The example demonstrates how to run different actions with the Quarky touch sensor to make a disco party in Python Coding Environment.

Code

sprite = Sprite('Cassy Dance')
quarky = Quarky()

import time

sprite.switchcostume('cassy-a')
sprite.gotoxy(0, 0)

while True:
  if quarky.ispadtouched("T1"):
    quarky.playsound("QuarkyIntro")

  if quarky.ispadtouched("T2"):
    quarky.showpattern("party colors")

  if quarky.ispadtouched("T3"):
    time.sleep(0.2)
    sprite.nextcostume()

  if quarky.ispadtouched("T4"):
    quarky.stopaudio()

Output

Read More
All articles loaded
No more articles to load