# File lib/nxt.rb, line 82
  def method_missing(method, *args, &block)
    name = method.id2name
    if /^motor_([abc])$/ =~ name
      motor($1, block)
    elsif /^motors_([abc]+?)$/ =~ name
      motors($1, block)
    elsif /^sensor_([1234])$/ =~ name
                        sensor($1, block)
                elsif /^sensor_(touch|sound|light|ultrasonic)$/ =~ name or
                                /^(touch|sound|light|ultrasonic)_sensor$/ =~ name
                        case $1
                                when 'touch'
                                        sensor(1, block)
                                when 'sound'
                                        sensor(2, block)
                                when 'light'
                                        sensor(3, block)
                                when 'ultrasonic'
                                        sensor(4, block)
                                else
                                        raise "'#{$1}' is not a valid sensor."
                        end
    else
        # if the method is not recognized, we assume it is a low-level NXTComm command
      m = @nxt.method(method)
      m.call(*args)
    end
  end