MicroPython evo#
Import the native Evo firmware module with:
import evo
The evo module is implemented in C and is available in both EVOX1P and
EVOX1E MicroPython firmware builds.
System Functions#
- evo_init(start_ble=True, console=True, max_chunk=160, debug=False)#
Initialise Evo runtime services. When
start_bleis true, the firmware starts the frozen BLE/download service using the configured BLE name.consoleenables BLE console forwarding,max_chunkcontrols BLE transfer chunking where supported, anddebugenables debug output.- Returns:
Truewhen initialisation completes.
- log(*args, sep=' ', end='\\n', stream='stdout')#
Print a message to the serial console and forward the same text to the BLE console if it is running.
- Returns:
None.
Configuration Functions#
- get_name()#
Read the configured board name.
- Returns:
String name.
- get_ble_name()#
Read the BLE advertising name used by Evo services.
- Returns:
String BLE name.
- get_wifi_name()#
Read the Wi-Fi name stored in Evo configuration.
- Returns:
String Wi-Fi name.
- get_controller_type()#
Read the stored controller type.
- Returns:
String controller type.
- get_config()#
Read the saved Evo configuration.
- Returns:
Dictionary containing
name,ble_name,wifi_nameandcontroller_type.
- set_name(name, reset=True)#
Update the saved board name. Names may contain letters, numbers,
_and-. By default the board resets after writing the configuration.- Returns:
Trueon success, otherwiseFalse.
- set_ble_name(name, reset=True)#
Update the saved BLE advertising name. By default the board resets after the value is written so the new name is used immediately.
- Returns:
Trueon success, otherwiseFalse.
- set_wifi_name(name, reset=True)#
Update the saved Wi-Fi name. By default the board resets after writing the configuration.
- Returns:
Trueon success, otherwiseFalse.
- set_controller_type(controller_type, reset=False)#
Store the expected controller type for runtime services.
- Returns:
Trueon success, otherwiseFalse.
Constants#
Motor Ports
M1, M2, M3 and M4.
Motor Types
GENERICWITHENCODER, GENERICWITHOUTENCODER, EV3LargeMotor,
EV3MediumMotor, GeekServoDCMotor, ITERMK495, ITERMK330,
ITERMK195, EVOMotor300 and EVOMotor100.
Stop Behaviour
COAST, BRAKE and HOLD.
Acceleration Profiles
ACCEL_NONE, ACCEL_TRAPEZOID and ACCEL_SCURVE.
PWM Singleton#
- EVOPWMDriver()#
Return the singleton native PWM driver object used by the motor module.
- Returns:
The native
EVOPWMDriversingleton.