The function sets its sprite’s X and Y position to the specified value. This block has no animation in its movement — it is the simplest way to move a sprite around the screen without displaying any animation (i.e. gliding). Therefore, this block is used whenever a sprite needs to jump to another spot.
Parameters
Name
Type
Description
Expected Values
Default Value
x
int
The x coordinate where the sprite need to be moved.
-240 to 240
100
y
int
The x coordinate where the sprite need to be moved.
Now we will connect the Ultrasonic Sensor to the Robot. The sensor and the robot have the following pins:
Ultrasonic Sensor Pins:
VCC
GND
Trig
Echo
Quarky Pins:
GND
V
D1
D2
We will start with connecting the ultrasonic sensor with Quarky using the 4 set wire provided in the kit. But, first, make the connection in the following way:
First, connect the VCC of the ultrasonic sensor with the V pin on the Quarky.
Connect the GND of the ultrasonic sensor with the Ground pin on the Quarky.
Connect Trig of the ultrasonic sensor with D1 pin on the Quarky.
Finally, connect the Echo of the ultrasonic sensor with the D2 pin on the Quarky.
Now we will connect the Ultrasonic Sensor to the Robot. The sensor and the robot have the following pins:
We will start with connecting the ultrasonic sensor with Quarky using the 4 set wire provided in the kit. But, first, make the connection in the following way:
First, connect the VCC of the ultrasonic sensor with the V pin on the Quarky.
Connect the GND of the ultrasonic sensor with the Ground pin on the Quarky.
Connect Trig of the ultrasonic sensor with D1 pin on the Quarky.
Finally, connect the Echo of the ultrasonic sensor with the D2 pin on the Quarky.
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()
A waste management system that will differentiate the waste based on its type. If it detects biodegradable waste, the LEDs Quarky’s matrix will turn green. If it’s non-biodegradable waste, the LEDs will turn blue.
A waste management system that will differentiate the waste based on its type in Python Coding Environment. If it detects biodegradable waste, the LEDs Quarky’s matrix will turn green. If it’s non-biodegradable waste, the LEDs will turn blue.
sprite = Sprite('Tobi')
pose = Posenet()
pose.video("on", 0)
pose.enablebox()
while True:
pose.analysecamera()
bodyPartCount = 0
for i in range(21):
if pose.isdetected(i, 1):
bodyPartCount += 1
sprite.say(str(bodyPartCount) + " Parts Detected")