Παρουσιαστικό#
Στυλό#
pen.move#
The pen.move(action) method is used to set the position of the VR Pen.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
The set position of the VR Pen as |
Επιστροφές: Καμία.
UP- the pen will not draw a line on the playground.DOWN- the pen will draw a colored line on the playground.
def main():
# Position the VR Pen down.
pen.move(DOWN)
# Move forward for 400 mm to draw a line.
drivetrain.drive_for(FORWARD, 400, MM)
pen.set_pen_color#
The pen.set_pen_color(color) method is used to set the color of the VR Pen.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
The color of the VR Pen: |
Επιστροφές: Καμία.
def main():
# Move the VR Pen down.
pen.move(DOWN)
# Set the VR Pen color to blue.
pen.set_pen_color(BLUE)
# Drive forward for 400 mm to draw a line.
drivetrain.drive_for(FORWARD, 400, MM)
pen.set_pen_width#
The pen.set_pen_width(width) method is used to set the width of the VR Pen.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
The width of the VR Pen: |
Επιστροφές: Καμία.
The default VR Pen width is THIN.
def main():
# Move the VR Pen down.
pen.move(DOWN)
# Set the VR Pen's width to medium.
pen.set_pen_width(MEDIUM)
# Drive forward for 400 mm to draw a line.
drivetrain.drive_for(FORWARD, 400, MM)
pen.set_pen_color_rgb#
The pen.set_pen_color_rgb(red, green, blue, opacity) method is used to set the RGB value for the VR Pen’s color.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
Η ένταση του κόκκινου χρώματος στην τιμή RGB, που κυμαίνεται από 0 έως 255. |
|
Η ένταση του πράσινου χρώματος στην τιμή RGB, που κυμαίνεται από 0 έως 255. |
|
Η ένταση του μπλε χρώματος στην τιμή RGB, που κυμαίνεται από 0 έως 255. |
|
Η διαφάνεια του χρώματος της πένας VR, που κυμαίνεται από 0 έως 100 τοις εκατό. |
Επιστροφές: Καμία.
def main():
# Move the VR Pen down.
pen.move(DOWN)
# Set the color to orange at full opacity.
pen.set_pen_color_rgb(225, 112, 52, 100)
# Drive forward for 400 MM to draw a line.
drivetrain.drive_for(FORWARD, 400, MM)
pen.fill#
The pen.fill(red, green, blue, opacity) method fills in the shape of whatever the VR Pen is on top of, for example:
Γραμμές πλέγματος |
Τετράγωνο πλέγματος |
Σε παιδικές χαρές χωρίς πλέγμα, γεμίζει ολόκληρο το δάπεδο της παιδικής χαράς. |
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
Η ένταση του κόκκινου χρώματος στην τιμή RGB, που κυμαίνεται από 0 έως 255. |
|
Η ένταση του πράσινου χρώματος στην τιμή RGB, που κυμαίνεται από 0 έως 255. |
|
Η ένταση του μπλε χρώματος στην τιμή RGB, που κυμαίνεται από 0 έως 255. |
|
Η διαφάνεια του χρώματος της πένας VR, που κυμαίνεται από 0 έως 100 τοις εκατό. |
Επιστροφές: Καμία.
def main():
# Fill the playground's floor with blue at full opacity.
pen.fill(43, 162, 202, 100)
Αποτύπωμα#
brain.print#
The brain.print(value, precision = 0) method is used to print words, numbers, and reported values to the Print Console.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
Any words, numbers, or sensors that report a value. Words must be in quotation marks: |
|
Optional. The amount of decimals reported from a value from a sensor or variable, from |
Επιστροφές: Καμία.
def main():
# Print the Drivetrain's current heading in degrees with 2 decimal points.
brain.print("Drivetrain's heading:",
drivetrain.heading(DEGREES), precision = 2)
brain.clear#
The brain.clear() method is used to clear all the rows in the Print Console and resets the cursor to the first line.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Επιστροφές: Καμία.
def main():
# Print "Project has started."
brain.print("Project has started.")
# Wait 3 seconds.
wait(3, SECONDS)
# Clear the print console.
brain.clear()
brain.new_line#
The brain.new_line() method is used to set the cursor to a new line in the Print Console.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Επιστροφές: Καμία.
def main():
# Print "Project has started."
brain.print("Project has started.")
# Move the cursor to a new line.
brain.new_line()
brain.set_print_color#
The brain.set_print_color(color) method is used to set the color of the text printed to the Print Console.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
The color of the text to be printed: |
Επιστροφές: Καμία.
def main():
# Set the print text color to red.
brain.set_print_color(RED)
# Print a message.
brain.print("This is red!")
μεταβλητή_παρακολούθησης#
The monitor_variable(“variable”, …) method is used to add variables to the Monitor Console so that the value of the variables can be seen and monitored.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
Οποιαδήποτε προηγουμένως ορισμένη καθολική μεταβλητή. |
Επιστροφές: Καμία.
# Create global variable.
disk_count = 1
def main():
# Add disk_count to the Monitor Console.
monitor_variable("disk_count")
αισθητήρας_παρακολούθησης#
The monitor_sensor(“sensor”, …) method is used to add sensors to the monitor console so that the sensor values can be monitored.
Αυτή είναι μια μέθοδος μη αναμονής και επιτρέπει σε οποιεσδήποτε επόμενες μεθόδους να εκτελούνται χωρίς καθυστέρηση.
Παράμετροι |
Περιγραφή |
|---|---|
|
Οποιοδήποτε υποστηριζόμενο αναγνωριστικό αισθητήρα. |
Επιστροφές: Καμία.
Υποστηριζόμενα αναγνωριστικά αισθητήρων:
brain.timer.timedrivetrain.is_donedrivetrain.is_movingdrivetrain.headingdrivetrain.rotationdrivetrain.velocity_rpmdrivetrain.velocity_percentarm_motor.is_donearm_motor.is_spinningarm_motor.position_degreesarm_motor.position_turnsarm_motor.velocity_rpmarm_motor.velocity_percentarm_motor_group.is_donearm_motor_group.is_spinningarm_motor_group.position_degreesarm_motor_group.position_turnsarm_motor_group.velocity_rpmarm_motor_group.velocity_percentintake_motor.is_doneintake_motor.is_spinningintake_motor.position_degreesintake_motor.position_turnsintake_motor.velocity_rpmintake_motor.velocity_percentintake_motor_group.is_doneintake_motor_group.is_spinningintake_motor_group.position_degreesintake_motor_group.position_turnsintake_motor_group.velocity_rpmintake_motor_group.velocity_percentcatapult_motor.is_donecatapult_motor.is_spinningcatapult_motor.position_degreescatapult_motor.position_turnscatapult_motor.velocity_rpmcatapult_motor.velocity_percentcatapult_tension_motor.is_donecatapult_tension_motor.is_spinningcatapult_tension_motor.position_degreescatapult_tension_motor.position_turnscatapult_tension_motor.velocity_rpmcatapult_tension_motor.velocity_percentintake_bumper.pressingbumper.pressingfront_distance.is_object_detectedfront_distance.object_distance_mmfront_distance.object_distance_inchesfront_optical.is_near_objectfront_optical.colorfront_optical.brightnessfront_optical.huecolor.is_near_objectcolor.colorcolor.brightnesscolor.hue
def main():
# Add the VR Robot's positional coordinates to the monitor console.
monitor_sensor("location.position")


