Table of Contents

Servo Sweep – Python

Example Description
The example demonstrates how to code the Quarky to make the servo sweep the perimeter in the Python Coding Environment.

Code

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

Angle = 0
while True:
  for i in range(0, 18):
    Angle += 10
    moveservo("Servo 1", Angle)
    time.sleep(0.01)

  for i in range(0, 18):
    Angle += -10
    moveservo("Servo 1", Angle)
    time.sleep(0.01)

Output