Package nxt :: Module direct

Module direct

source code

Use for direct communication with the NXT ***EXTREMELY ADVANCED USERS ONLY***

Functions
 
start_program(opcode, fname) source code
 
stop_program(opcode) source code
 
play_sound_file(opcode, loop, fname) source code
 
play_tone(opcode, frequency, duration)
Play a tone at frequency (Hz) for duration (ms)
source code
 
set_output_state(opcode, port, power, mode, regulation, turn_ratio, run_state, tacho_limit) source code
 
set_input_mode(opcode, port, sensor_type, sensor_mode) source code
 
get_output_state(opcode, port) source code
 
get_input_values(opcode, port) source code
 
reset_input_scaled_value(opcode, port) source code
 
message_write(opcode, inbox, message) source code
 
reset_motor_position(opcode, port, relative) source code
 
get_battery_level(opcode) source code
 
stop_sound_playback(opcode) source code
 
keep_alive(opcode) source code
 
ls_get_status(opcode, port)
Get status of low-speed sensor (ultrasonic)
source code
 
ls_write(opcode, port, tx_data, rx_bytes)
Write a low-speed command to a sensor (ultrasonic)
source code
 
ls_read(opcode, port)
Read a low-speed sensor value (ultrasonic)
source code
 
get_current_program_name(opcode) source code
 
message_read(opcode, remote_inbox, local_inbox, remove) source code
Variables
  OPCODES = {0x00:(start_program, _parse_simple), 0x01:(stop_pro...
  __package__ = 'nxt'
Variables Details

OPCODES

Value:
{0x00:(start_program, _parse_simple), 0x01:(stop_program, _parse_simpl\
e), 0x02:(play_sound_file, _parse_simple), 0x03:(play_tone, _parse_sim\
ple), 0x04:(set_output_state, _parse_simple), 0x05:(set_input_mode, _p\
arse_simple), 0x06:(get_output_state, _parse_get_output_state), 0x07:(\
get_input_values, _parse_get_input_values), 0x08:(reset_input_scaled_v\
alue, _parse_simple), 0x09:(message_write, _parse_simple), 0x0A:(reset\
_motor_position, _parse_simple), 0x0B:(get_battery_level, _parse_get_b\
attery_level), 0x0C:(stop_sound_playback, _parse_simple), 0x0D:(keep_a\
...