In the middle of the page, you will see a space for you to write your own code. The section is labeled as # Welcome to Python for Robolink! Write your Python code below.
.
Upon creating a new Python file, starter code will be generated for you that imports the CoDrone EDU library, creates a new drone object, pairs the drone, and closes the drone connection at the completion of your program.
PLEASE NOTE:
- Python for Robolink currently does not support custom object names for the drone. At all times, use the following line of code to establish the drone:
drone = Drone()
.
- In the case you accidentally erase any of the starter code statements, opening a new tab in Python for Robolink will cause them to reappear.
- If there is a typo in your statements, Python for Robolink will notify you in the console.
To get familiar with Python for Robolink, print “Hello, world” by typing it in the middle section of the code editor. You can also copy and paste this code:
print("Hello, world")
WARNING
The stop command should only be used in emergencies or when safety has become a concern. In all other circumstances, you should use the land command to bring your drone safely to the ground.
To run or stop code, use the “Run Code”, “Stop”, or “Land” buttons at the top of the page. When flying, the “Stop” button will emergency stop the motors, so we recommend using the “Land” button whenever possible if you need to interrupt your code. Even if your drone is not flying, you can use these buttons to interrupt your program.