![]() SpheroEduAPI ¶ R2-D2 & R2-Q5 Lights ¶ class spherov2.sphero_edu. BB-9E Lights ¶ class spherov2.sphero_edu. For example, the above green color is expressed as set_back_led(Color(0, 255, 0)). ![]() ![]() set_back_led ( color : ) ¶Ĭhanges the color of the back LED light, aka the “Tail Light” or “Aim Light.” Set this using RGB (red, green, blue) values on a scale of 0 - 255. For example, the magenta color is expressed as set_front_color(Color(239, 0, 255)). Set this using RGB (red, green, blue) values on a scale of 0 - 255. SpheroEduAPI ¶ set_front_led ( color : ) ¶Ĭhanges the color of RVR’s front two LED headlights together. Sphero RVR Lights ¶ class spherov2.sphero_edu. Sphero BOLT has this as an RGB LED on the back, whereas previous Spheros are limited to blue only. For example, the green color is expressed as set_back_led(Color(0, 255, 0)). For example, the magenta color is expressed as set_front_color(Color(239, 0, 255)) set_back_led ( color : ) ¶Ĭhanges the color of the back LED light, aka the “Tail Light” or “Aim Light.” Set this using RGB (red, green, blue) values on a scale of 0 - 255. SpheroEduAPI ¶ set_front_led ( color : ) ¶Ĭhanges the color of the front LED light. The matrix has 3 methods to program in increasing abstraction and sophistication that are very fun to play with! The 3 methods are setting pixels, text, and animations. Sphero BOLT has unique lighting capabilities with a front led, back led, and 8x8 led matrix. Set_back_led ( 0 ) # Dim delay ( 0.33 ) set_back_led ( 255 ) # Bright delay ( 0.33 ) Sphero BOLT Lights ¶ For example, to create a dim and a bright blink sequence use: Use time.sleep() to set it on for a duration. For example, use set_back_led(255) to set the back LED to full brightness. Sets the brightness of the back aiming LED, aka the “Tail Light.” This LED is limited to blue only, with a brightness scale from 0 to 255. SpheroEduAPI ¶ set_back_led ( color : int ) ¶ Lights control the color and brightness of LEDs on a robot. The R2-D2 and R2-Q5 Droids are physically different from other Sphero robots, so there are some unique commands that only they can use. Star Wars Droid Movements ¶ class spherov2.sphero_edu. Nearby metallic and magnetic objects can affect the accuracy of the compass, so try to use this feature in an area without that interference, or hold it up in the air if you can’t get away from interference. Sphero BOLT has a compass (magnetometer) sensor that has unique functionality. For example, if you set heading = 0°, speed = 60, duration = 3s, the robot would roll forward for 3s at a moderate speed. Sphero robots move with three basic instructions: heading, speed, and duration. You can use sequential movement commands by separating them with line breaks, like the Hello World! program. Movements control the robot’s motors and control system. set_main_led ( Color ( r = 0, g = 0, b = 255 )) droid. find_toy () with SpheroEduAPI ( toy ) as droid : droid. Import time from spherov2 import scanner from spherov2.sphero_edu import SpheroEduAPI from spherov2.types import Color toy = scanner.
0 Comments
Leave a Reply. |