Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
5いいね 577回再生

Build, Code and Play | Wirelessly Controlled Robot | Quarky in Action

We’re going to control Quarky wirelessly using the arrow keys of the keyboard of your desktop in the PictoBlox.

Here’s how:
Using the up arrow key, we will make Quarky move forward.
Using the down arrow key, we will make it move backward.
Using the right arrow key, it will move right.
Using the left arrow key, it will move left.
When none of the arrow keys is pressed, Quarky should stop moving.

PictoBlox Python Code:
sprite = Sprite('Tobi')
quarky = Quarky()

while True:

if sprite.iskeypressed("up arrow"):
quarky.runrobot("FORWARD", 50)
elif sprite.iskeypressed("down arrow"):
quarky.runrobot("BACKWARD", 50)
elif sprite.iskeypressed("left arrow"):
quarky.runrobot("LEFT", 50)
elif sprite.iskeypressed("right arrow"):
quarky.runrobot("RIGHT", 50)
else:
quarky.stoprobot()


#QuarkyRobot #robotics #roboticsprojectcenters #PrecisionControl #programming #interfacing #technology #DIY #stem #engineering #innovation #futuretech #education #wirelesscontroller #robochamps #brightchamps #pictoblox #python #coding

コメント