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_ble is true, the firmware starts the frozen BLE/download service using the configured BLE name. console enables BLE console forwarding, max_chunk controls BLE transfer chunking where supported, and debug enables debug output.

Returns:

True when 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_name and controller_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:

True on success, otherwise False.

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:

True on success, otherwise False.

set_wifi_name(name, reset=True)#

Update the saved Wi-Fi name. By default the board resets after writing the configuration.

Returns:

True on success, otherwise False.

set_controller_type(controller_type, reset=False)#

Store the expected controller type for runtime services.

Returns:

True on success, otherwise False.

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 EVOPWMDriver singleton.

class EVOPWMDriver

Native low-level PCA9685 PWM singleton.

freq([freq])#

Get or set the PWM frequency.

Returns:

Current frequency when called without an argument. When setting a frequency, returns None.

pwm(channel, on, off)#

Set one PCA9685 channel with raw on and off counts.

Returns:

None.