Module: LegoNXT
- Defined in:
- lib/lego_nxt.rb,
lib/lego_nxt/brick.rb,
lib/lego_nxt/types.rb,
lib/lego_nxt/errors.rb,
lib/lego_nxt/version.rb,
lib/lego_nxt/constants.rb,
lib/lego_nxt/usb_connection.rb
Overview
LegoNXT is a library for working with the LEGO NXT bricks.
Defined Under Namespace
Modules: DirectOps, DirectOpsErrors, SystemOps, SystemOpsErrors Classes: BadOpCodeError, BadResponseError, Brick, LegoNXTError, NoDeviceError, SignedByte, SignedLong, SignedWord, StatusError, TransmitError, UnsignedByte, UnsignedLong, UnsignedWord, UsbConnection
Constant Summary
- VERSION =
The version of the LegoNXT code
"0.0.2"
Class Method Summary (collapse)
-
+ (LegoNXT::Brick) connect
A helper method that attempt to attach to a brick and returns a object.
- + (Object) disconnect
Class Method Details
+ (LegoNXT::Brick) connect
A helper method that attempt to attach to a brick and returns a object.
13 14 15 16 |
# File 'lib/lego_nxt.rb', line 13 def LegoNXT::connect @found_connection ||= LegoNXT::UsbConnection.new LegoNXT::Brick.new @found_connection end |
+ (Object) disconnect
18 19 20 21 22 23 |
# File 'lib/lego_nxt.rb', line 18 def LegoNXT::disconnect unless @found_connection.nil? @found_connection.close @found_connection = nil end end |