Tips
Here are some tips.
Modules
You can only download 1 Python file at a time to the EXP Brain, which makes creating and using Python modules nearly impossible. However, if you copy your Python files to an SD card, you can import them as you would usually import proper modules. In this example, you have a file called util.py
and you have copied this file to the SD card.
def log(brain, s):
brain.screen.clear_line()
brain.screen.set_cursor(1, 1)
brain.screen.print(s)
Then, you may import and use the code in your main application.
from vex import *
from util import *
brain = Brain()
log(brain, 'hello, world')
For some reason, the MicroPython runtime environment on the EXP Brain does not respect normal Python scoping rules (Local, Enclosing, Global, Built-in: LEGB) when importing a module from the SD card. As such, you will have to write your functions to pass in the VEX object instances. In the example above, we pass in the brain instance so that we may access the screen
field of the instance.
Wheel
The diagram below will help you understand how to calculate the drivetrain parameters.
wheel base
: the distance between the center of the wheels on the same sidetrack width
: the distance between the wheels on opposite sideswheel travel
: the diameter of a wheel times PI (eg 3.1415)