|
/Users/cpanrun/depot/main/contrib-patched/perl/CPAN/src/LEGO-RCX/blib/lib/LEGO/RCX.pm |
RCX
use LOGO::RCX;
$rcx = new LEGO::RCX();
# # Turn motor A on for 10 seconds, then turn # it off #
$rcx->motorOn( "A" );
sleep( 10 );
$rcx->motorOff( "A" );
This module allows one to communicate with the Lego MindStorms(R) RCX
brick from a workstation through the IR tower.
The internals of this module are based of the rcx.tcl by Peter Pletcher <peterp@autobahn.org> and Laurent Demailly <L@Demailly.com>. I have hower made my external interface to this module OO based, and changed the way a few things are done.
Without there tcl module I would have never been able to complete this in a timely manner. Thanks guys.
ping() or alive()motor(s) on
Motors are specifed in string format eg: ``A'' eg: ``bc''
motor(s) off
Motors are specifed in string format eg: ``A'' eg: ``bc''
motor(s) output
Motors are specifed in string format eg: ``A'' eg: ``bc''
Motors are specifed in string format eg: ``A'' eg: ``bc''
Motors are specifed in string format eg: ``A'' eg: ``bc''
0 Blip 1 Beep beep 2 Downward tones 3 Upward tones 4 Low buzz 5 Fast upward tones
frequency is in Hz and duration is in 1/100th of a second.
The valid display values are:
0 Watch 1 Sensor 1 2 Sensor 2 3 Sensor 3 4 Motor A 5 Motor B 6 Motor C
powerOff()powerOff() calls will fail.
start()If the loadNQClist method has been called then you can specify a task name
If the loadNQClist method has been called then you can specify a task name
If the loadNQClist method has been called then you can specify a subroutine name.
$SENSOR_TYPE_RAW $SENSOR_TYPE_TOUCH $SENSOR_TYPE_TEMPERATURE $SENSOR_TYPE_LIGHT $SENSOR_TYPE_ROTATION
The mode value can be any one of the following.
$SENSOR_MODE_RAW $SENSOR_MODE_BOOL $SENSOR_MODE_EDGE $SENSOR_MODE_PULSE $SENSOR_MODE_PERCENT $SENSOR_MODE_CELSIUS $SENSOR_MODE_FAHRENHEIT $SENSOR_MODE_ROTATION
The kind value can be any one of the following.
$SENSOR_TOUCH $SENSOR_LIGHT $SENSOR_ROTATION $SENSOR_CELSIUS $SENSOR_FAHRENHEIT $SENSOR_PULSE $SENSOR_EDGE
If the loadNQClist method has been called then you can specify a variable name instead of a number.
If the loadNQClist method has been called then you can specify a variable name instead of a number.
deleteAllTasks()If the loadNQClist method has been called then you can specify a task name.
deleteAllSubs()If the loadNQClist method has been called then you can specify a subroutine name.
getBattery()getVersion()uploadDatalog()
0x00-0x1f
Variable value (source 0, variables 0..31)
0x20-0x23
Timer value (source 1, timers 0..3)
0x40-0x42
Sensor reading (source 9, sensors 0..2)
0x80
Clock reading (source 14)
I have developed this software under Linux. I know it works there.
John C. Quillan quillan@cox.net
01/29/2000 VER 0.5 First Version
02/04/2000 VER 0.6 Removed some commented code
Added posix serial code.
02/06/2000 VER 0.7 Added the alive/ping method
Added the time out for communications.
Added the setCommTimeout method
Added the uploadDatalog method
02/22/2000 VER 0.8 Fixed wrong named method in NQC translation
Added getVersion
Added clearSensor
Started sensor config code
Moved package RCX to Lego::RCX
Made a real perl module with Makefile.PL
Added div,mul,add,sub,and,or
variable
Added setTXRange
Added deleteAllTasks and deleteAllSubs
Added deleteTask and deleteSub
02/29/2000 VER 0.9 Moved package from Lego::RCX to LEGO::RCX
Added setSensor, setSensorMode, setSensorType
Fixed / 1000 bug in getReg.
Fixed bug in pattern matches that was not catching
0x0a characters. Now a single line match.
04/16/2000 VER 1.00 Clean up source a little bit.
Made README more descriptive for CPAN users.
Fixed some typo in the pod documentation for the
usage. Sorry for any problems this may have
caused.
Fixed a typo in the warning.
Added a few samples to start off with
|
/Users/cpanrun/depot/main/contrib-patched/perl/CPAN/src/LEGO-RCX/blib/lib/LEGO/RCX.pm |