തോന്നുന്നു#

പേന#

pen.move#

VR പേനയുടെ സ്ഥാനം സജ്ജീകരിക്കാൻ pen.move(action) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

action

VR പേനയുടെ സെറ്റ് സ്ഥാനം UP അല്ലെങ്കിൽ DOWN ആയി.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

  • UP - കളിസ്ഥലത്ത് പേന ഒരു രേഖ വരയ്ക്കില്ല.

  • DOWN - പേന കളിസ്ഥലത്ത് ഒരു നിറമുള്ള വര വരയ്ക്കും.

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#

VR പേനയുടെ നിറം സജ്ജമാക്കാൻ pen.set_pen_color(color) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

color

VR പേനയുടെ നിറം: BLACK, RED, GREEN, അല്ലെങ്കിൽ BLUE.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

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#

VR പേനയുടെ വീതി സജ്ജമാക്കാൻ pen.set_pen_width(width) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

width

VR പേനയുടെ വീതി: EXTRA_THIN, THIN, MEDIUM, WIDE, അല്ലെങ്കിൽ EXTRA-WIDE.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

ഡിഫോൾട്ട് VR പേനയുടെ വീതി 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#

VR പേനയുടെ നിറത്തിന് RGB മൂല്യം സജ്ജമാക്കാൻ pen.set_pen_color_rgb(red, green, blue, opacity) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

red

RGB മൂല്യത്തിൽ ചുവപ്പ് നിറത്തിന്റെ തീവ്രത 0 മുതൽ 255 വരെയാണ്.

green

RGB മൂല്യത്തിൽ പച്ച നിറത്തിന്റെ തീവ്രത, 0 മുതൽ 255 വരെയാണ്.

blue

RGB മൂല്യത്തിൽ നീല നിറത്തിന്റെ തീവ്രത, 0 മുതൽ 255 വരെയാണ്.

opacity

വിആർ പേനയുടെ നിറങ്ങളുടെ സുതാര്യത 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#

pen.fill(red, green, blue, opacity) രീതി VR പേനയുടെ മുകളിലുള്ള ആകൃതിയിൽ പൂരിപ്പിക്കുന്നു, ഉദാഹരണത്തിന്:

​ചെറിയ ഗ്രിഡ് ബോക്സുകളുള്ള ഒരു പ്രതലത്തിലാണ് വിആർ റോബോട്ട് ഇരിക്കുന്നത്, റോബോട്ടിന് പിന്നിൽ നീല നിറത്തിലുള്ള ഒരു ഗ്രിഡ് ലൈൻ കാണിക്കുന്നു.

​ഒരു VR കളിസ്ഥലത്തിന്റെ ഒരു മൂലയിൽ, നീല നിറത്തിൽ നിറച്ച കോർണർ ഗ്രിഡ് ചതുരം കാണിക്കുന്നു, അതിനടുത്തായി ചതുരത്തിൽ VR റോബോട്ട് ഉണ്ട്.

​കടും നീല തറയുടെ മുകളിൽ ഒരു VR റോബോട്ട്.

ഗ്രിഡ് ലൈനുകൾ

ഗ്രിഡ് ചതുരം

ഗ്രിഡ് ഇല്ലാത്ത കളിസ്ഥലങ്ങളിൽ, അത് മുഴുവൻ കളിസ്ഥല നിലയും നിറയ്ക്കും.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

red

RGB മൂല്യത്തിൽ ചുവപ്പ് നിറത്തിന്റെ തീവ്രത 0 മുതൽ 255 വരെയാണ്.

green

RGB മൂല്യത്തിൽ പച്ച നിറത്തിന്റെ തീവ്രത, 0 മുതൽ 255 വരെയാണ്.

blue

RGB മൂല്യത്തിൽ നീല നിറത്തിന്റെ തീവ്രത, 0 മുതൽ 255 വരെയാണ്.

opacity

വിആർ പേനയുടെ നിറങ്ങളുടെ സുതാര്യത 0 മുതൽ 100 ​​ശതമാനം വരെയാണ്.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

def main():
    # Fill the playground's floor with blue at full opacity.
    pen.fill(43, 162, 202, 100)

അച്ചടിക്കുക#

brain.print#

പ്രിന്റ് കൺസോളിലേക്ക് വാക്കുകൾ, അക്കങ്ങൾ, റിപ്പോർട്ട് ചെയ്ത മൂല്യങ്ങൾ എന്നിവ പ്രിന്റ് ചെയ്യാൻ brain.print(value, precision = 0) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

value

ഒരു മൂല്യം റിപ്പോർട്ട് ചെയ്യുന്ന ഏതെങ്കിലും വാക്കുകൾ, അക്കങ്ങൾ അല്ലെങ്കിൽ സെൻസറുകൾ. വാക്കുകൾ ഉദ്ധരണി ചിഹ്നങ്ങളിൽ ആയിരിക്കണം: ”.

precision

ഓപ്ഷണൽ. precision = 0-precision = 9എന്നതിൽ നിന്ന് ഒരു സെൻസറിൽ നിന്നോ വേരിയബിളിൽ നിന്നോ ഒരു മൂല്യത്തിൽ നിന്ന് റിപ്പോർട്ട് ചെയ്ത ദശാംശങ്ങളുടെ അളവ്. ഡിഫോൾട്ട് പ്രിന്റ് പ്രിസിഷൻ 0 ആണ്.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

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#

പ്രിന്റ് കൺസോളിലെ എല്ലാ വരികളും മായ്‌ക്കുന്നതിനും കഴ്‌സർ ആദ്യ വരിയിലേക്ക് പുനഃസജ്ജമാക്കുന്നതിനും brain.clear() രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

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#

പ്രിന്റ് കൺസോളിൽ കഴ്‌സർ ഒരു പുതിയ വരിയിലേക്ക് സജ്ജമാക്കാൻ brain.new_line() രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

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#

പ്രിന്റ് കൺസോളിൽ പ്രിന്റ് ചെയ്യുന്ന വാചകത്തിന്റെ നിറം സജ്ജമാക്കാൻ brain.set_print_color(color) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

color

പ്രിന്റ് ചെയ്യേണ്ട വാചകത്തിന്റെ നിറം: BLACK, RED, GREEN, അല്ലെങ്കിൽ BLUE. സ്ഥിരസ്ഥിതിയായി, നിറം BLACK ആണ്.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

def main():
    # Set the print text color to red.
    brain.set_print_color(RED)
    # Print a message.
    brain.print("This is red!")

മോണിറ്റർ_വേരിയബിൾ#

മോണിറ്റർ കൺസോളിലേക്ക് വേരിയബിളുകൾ ചേർക്കാൻ monitor_variable(“variable”, …) രീതി ഉപയോഗിക്കുന്നു, അതുവഴി വേരിയബിളുകളുടെ മൂല്യം കാണാനും നിരീക്ഷിക്കാനും കഴിയും.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

variable

മുമ്പ് സജ്ജീകരിച്ച ഏതെങ്കിലും ഗ്ലോബൽ വേരിയബിൾ.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

# Create global variable.
disk_count = 1

def main():
    # Add disk_count to the Monitor Console.
    monitor_variable("disk_count")

മോണിറ്റർ_സെൻസർ#

സെൻസർ മൂല്യങ്ങൾ നിരീക്ഷിക്കാൻ കഴിയുന്ന തരത്തിൽ മോണിറ്റർ കൺസോളിലേക്ക് സെൻസറുകൾ ചേർക്കാൻ monitor_sensor(“sensor”, …) രീതി ഉപയോഗിക്കുന്നു.

ഇതൊരു നോൺ-വെയിറ്റിംഗ് രീതിയാണ്, തുടർന്നുള്ള ഏത് രീതികളും കാലതാമസമില്ലാതെ നടപ്പിലാക്കാൻ ഇത് അനുവദിക്കുന്നു.

പാരാമീറ്ററുകൾ

വിവരണം

sensor

പിന്തുണയ്ക്കുന്ന ഏതെങ്കിലും സെൻസർ ഐഡന്റിഫയർ.

റിട്ടേണുകൾ: ഒന്നുമില്ല.

പിന്തുണയ്ക്കുന്ന സെൻസർ ഐഡന്റിഫയറുകൾ:

  • brain.timer.time

  • drivetrain.is_done

  • drivetrain.is_moving

  • drivetrain.heading

  • drivetrain.rotation

  • drivetrain.velocity_rpm

  • drivetrain.velocity_percent

  • arm_motor.is_done

  • arm_motor.is_spinning

  • arm_motor.position_degrees

  • arm_motor.position_turns

  • arm_motor.velocity_rpm

  • arm_motor.velocity_percent

  • arm_motor_group.is_done

  • arm_motor_group.is_spinning

  • arm_motor_group.position_degrees

  • arm_motor_group.position_turns

  • arm_motor_group.velocity_rpm

  • arm_motor_group.velocity_percent

  • intake_motor.is_done

  • intake_motor.is_spinning

  • intake_motor.position_degrees

  • intake_motor.position_turns

  • intake_motor.velocity_rpm

  • intake_motor.velocity_percent

  • intake_motor_group.is_done

  • intake_motor_group.is_spinning

  • intake_motor_group.position_degrees

  • intake_motor_group.position_turns

  • intake_motor_group.velocity_rpm

  • intake_motor_group.velocity_percent

  • catapult_motor.is_done

  • catapult_motor.is_spinning

  • catapult_motor.position_degrees

  • catapult_motor.position_turns

  • catapult_motor.velocity_rpm

  • catapult_motor.velocity_percent

  • catapult_tension_motor.is_done

  • catapult_tension_motor.is_spinning

  • catapult_tension_motor.position_degrees

  • catapult_tension_motor.position_turns

  • catapult_tension_motor.velocity_rpm

  • catapult_tension_motor.velocity_percent

  • intake_bumper.pressing

  • bumper.pressing

  • front_distance.is_object_detected

  • front_distance.object_distance_mm

  • front_distance.object_distance_inches

  • front_optical.is_near_object

  • front_optical.color

  • front_optical.brightness

  • front_optical.hue

  • color.is_near_object

  • color.color

  • color.brightness

  • color.hue

def main():
    # Add the VR Robot's positional coordinates to the monitor console.
    monitor_sensor("location.position")