1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
Brick
=====
.. automodule:: nxt.brick
.. autoclass:: Brick
Connection Management
---------------------
.. automethod:: Brick.close
You can also use the context manager interface::
with nxt.locator.find() as b:
b.play_tone(440, 1000)
# Here, connection is closed automatically.
Brick Information
-----------------
.. automethod:: Brick.get_device_info
.. automethod:: Brick.get_battery_level
.. automethod:: Brick.get_firmware_version
.. automethod:: Brick.set_brick_name
.. automethod:: Brick.keep_alive
Sound
-----
.. automethod:: Brick.play_tone_and_wait
.. automethod:: Brick.play_sound_file
.. automethod:: Brick.play_tone
.. automethod:: Brick.stop_sound_playback
Motors and Sensors
------------------
.. automethod:: Brick.get_motor
.. automethod:: Brick.get_sensor
Programs
--------
.. automethod:: Brick.start_program
.. automethod:: Brick.stop_program
.. automethod:: Brick.get_current_program_name
File System Access
------------------
Brick file system has no directory and file names are not case sensitive.
.. automethod:: Brick.open_file
.. automethod:: Brick.find_files
.. automethod:: Brick.file_delete
.. automethod:: Brick.delete_user_flash
Mailboxes
---------
Mailboxes can be used to exchange messages with the running program.
.. automethod:: Brick.message_write
.. automethod:: Brick.message_read
Low Level Modules Access
------------------------
Low level modules access allows to read and write directly in modules
memory. This can be used for example to take a screenshot or to debug the
virtual machine. You need to look at the firmware source code for how to
use it.
.. automethod:: Brick.find_modules
.. automethod:: Brick.read_io_map
.. automethod:: Brick.write_io_map
Low Level Output Ports Methods
------------------------------
These are low level methods, you can use the :mod:`nxt.motor` module for an
easier interface.
.. automethod:: Brick.set_output_state
.. automethod:: Brick.get_output_state
.. automethod:: Brick.reset_motor_position
Low Level Intput Ports Methods
------------------------------
This are low level methods, you can use the :mod:`nxt.sensor` module for an
easier interface.
.. automethod:: Brick.set_input_mode
.. automethod:: Brick.get_input_values
.. automethod:: Brick.reset_input_scaled_value
.. automethod:: Brick.ls_get_status
.. automethod:: Brick.ls_write
.. automethod:: Brick.ls_read
Low Level Methods
-----------------
Do not use these functions unless you know exactly what you are doing.
.. automethod:: Brick.file_open_read
.. automethod:: Brick.file_open_write
.. automethod:: Brick.file_read
.. automethod:: Brick.file_write
.. automethod:: Brick.file_close
.. automethod:: Brick.file_find_first
.. automethod:: Brick.file_find_next
.. automethod:: Brick.file_open_write_linear
.. automethod:: Brick.file_open_write_data
.. automethod:: Brick.file_open_append_data
.. automethod:: Brick.module_find_first
.. automethod:: Brick.module_find_next
.. automethod:: Brick.module_close
.. automethod:: Brick.poll_command_length
.. automethod:: Brick.poll_command
.. automethod:: Brick.boot
.. automethod:: Brick.bluetooth_factory_reset
|