module NXT::Command::LowSpeed

An implementation of all the low speed I2C related NXT commands:

This class can also be used to talk to other third-party accessories connected in the input ports on the NXT brick that talk using I2C low speed master/slave communication.

Constants

COMMAND_IDENTIFIER

Public Instance Methods

command_type() click to toggle source
# File lib/nxt/commands/low_speed.rb, line 24
def command_type
  COMMAND_TYPES[:direct]
end
ls_clear_buffer() click to toggle source
# File lib/nxt/commands/low_speed.rb, line 28
def ls_clear_buffer
  ls_read
rescue StandardError
  nil
end
ls_get_status(response_required: false) click to toggle source
# File lib/nxt/commands/low_speed.rb, line 34
def ls_get_status(response_required: false)
  send_and_receive(COMMAND_IDENTIFIER[:ls_get_status], [], response_required)
end
ls_read(response_required: false) click to toggle source
# File lib/nxt/commands/low_speed.rb, line 42
def ls_read(response_required: false)
  send_and_receive(COMMAND_IDENTIFIER[:ls_read], [], response_required)
end
ls_write(response_required: false) click to toggle source
# File lib/nxt/commands/low_speed.rb, line 38
def ls_write(response_required: false)
  send_and_receive(COMMAND_IDENTIFIER[:ls_write], [], response_required)
end