Loginskip to content

Archive for February 12th, 2008

BricxCC Scripting

Tuesday, February 12th, 2008

BricxCC now has preliminary but fully functional support for compiling and executing PC-based scripts to control your programmable brick (NXT, RCX, Spybot, whatever).  These scripts can be edited in BricxCC with syntax highlighting and (coming soon) code and argument completion/insight support.  The active brick connection is used to send commands to the brick.  The exact same interface used internally by BricxCC (originally based on the Spirit OCX control) to communicate with a programmable brick is exposed within the scripting language.  The scripting language is RemoteObjects Pascal Script.  Here are a couple sample scripts:

program joybtn01p;

const
  OUT_C = 4;

begin
  BrickComm.SetMotorPower(OUT_C, 2, 4);
  BrickComm.SetFwd(OUT_C)
  BrickComm.MotorsOn(OUT_C);
end.

program joybtn01r;

const
  OUT_C = 4;

begin
  BrickComm.MotorsOff(OUT_C);
end.

These scripts will work for either a connection to an RCX or to an NXT.  The BrickComm class’s public interface is shown at

http://bricxcc.sourceforge.net/uSpirit.html

BricxCC also has a mechanism for assigning scripts to joystick button press and release events (up to 32 buttons).  The first script above would execute when the joystick button 1 is pressed since it is named joybtn01p.rops while the second would execute when button 1 is released.  These script files must be located at

C:\Documents and Settings\jhansen\Application Data\JoCar Consulting\BricxCC\3.3

replacing “jhansen” with your own username.

All the pascal scripts have a .rops extension.  If you have a script open in an editor window you can compile it and run it using the standard BricxCC compile and Run toolbar buttons or menu items.  You can define Pascal Script templates and customize the syntax highlighting color scheme like you can with any other supported programming language.

Soon the scripting language will have access to all of the tool windows in BricxCC.  You can even write scripts that display GUI dialogs with event handlers, etc…

http://bricxcc.sourceforge.net/test_release.zip

John Hansen

Challenge No 4 - last 3 weeks

Tuesday, February 12th, 2008

As you remember, there are less than 3 weeks for the deadline on the 4th challenge. There were very nice contributions submitted so far, but it is still open to others. The challenge is sponsored by mindsensors.com, contributing 60USD coupon for their online shop for the winner.

PF Speed control (and more) in NBC/NXC

Tuesday, February 12th, 2008

John Hansen published a test release of NBC/NXC with better interface to HiTecnic IRLink, allowing speed (PWM) contol of PF motors and other stuff.

Check it here:
http://bricxcc.sourceforge.net/

NXTLog

Tuesday, February 12th, 2008

Here’s some “inside information” I received about NXTLog:

1) People need to remember that a large part of the moderation is done by fellow AFOLs as a volunteer job, so there will be accidental inconsistencies
2) Yes, there was a “change” on NXTLog…LEGO legal said no more links of any kind to external sites (though official implementation is delayed as LEGO figures out what to do about the many links that are already posted
3) Yes, comments with names are rejected

Bottom line: LEGO is working to improve NXTLog. Give them a little more time