В момента ресурсът е наличен само на английски

What we see in our SPIKE project Pro Preview

Seeing a Python code for the first time can seem a bit scary, especially if you have only programmed with blocks before. This tutorial explains the initial code in the LEGO SPIKE project briefly, as well as what it does.

Необходимо е да се абонирате за FLLCasts.com, за да достъпите това видео

Абонирай се

  • #1657
  • 20 Aug 2020
from spike import PrimeHub, LightMatrix, Button, StatusLight, ForceSensor, MotionSensor, Speaker, ColorSensor, App, DistanceSensor, Motor, MotorPair
from spike.control import wait_for_seconds, wait_until, Timer

hub = PrimeHub() 


The first two lines introduce commands that we can use below them. We will look at them in-depth later on.

The last line in the code is the command for displaying an image using the hub lights. In this case, the image is called "HAPPY" and it is a little smiley face :)