pBrick2pBrick – pbrick.info https://pbrick.info Random information about all discontinued LEGO pbricks (programmable bricks) Fri, 24 Oct 2014 18:28:49 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 Controlling a MicroScout from an RCX using VLL https://pbrick.info/2013/10/microscout-rcx-vll/ https://pbrick.info/2013/10/microscout-rcx-vll/#respond Fri, 04 Oct 2013 20:08:02 +0000 http://pbrick.info/?p=45 The MicroScout brick has one motor, a light sensor, display and can make R2D2-like beepy noises. It has 7 built-in programs, and a mysterious “P” mode in which it can be respond to external commands and can even be programmed via the light sensor. LEGO calls this Visible Light Link (VLL), and it has been used in other bricks as well, like the Code Pilot.

So I decided to hook up a standard LEGO 9v Light 2×1 brick to one of the OUT ports on my RCX, and see if I could get it to work. Here is the setup (and my first attempt at Leocad):rcxvll building instructionsThe lamp doesn’t really show up well in the above picture, but it’s simply one of these.

Now basically the light needs to flash in certain patterns to transfer information. For finding out what those patterns are I need to acknowledge Doug Eaton who did a great job of figuring it all out and putting a great write-up online. Another great resource was Barnaby Walter’s page, who achieved the same using the LEGO fibre-optic elements.

I have written a rcxvll.nqh library which contains all the VLL commands the MicroScout recognizes, together with a little test program which runs a sequence of the direct commands which you can use to test connectivity.

To successfully use it all together, make sure to build your setup first, turn on the bricks, upload program to the RCX, set the MicroScout to P mode, then run the RCX program.

You can barely see the light flashing in the video, but it is!

Share

]]>
https://pbrick.info/2013/10/microscout-rcx-vll/feed/ 0
Controlling a Spybotics pbrick using an RCX https://pbrick.info/2013/10/controlling-a-spybotics-pbrick-using-an-rcx/ https://pbrick.info/2013/10/controlling-a-spybotics-pbrick-using-an-rcx/#respond Thu, 03 Oct 2013 17:43:23 +0000 http://pbrick.info/?p=35 The LEGO MindStorms RCX is capable of sending remote control IR signals to a LEGO Spybotics brick. This opens up a ton of new possibilities, essentially giving the RCX access to two more motors (theoretically even six as you can control up to three Spybotics over different channels).

The RCX has been set up real simply with three touch sensors, one for left, one forward and one right. The programming is made pretty easy using NQC:

task main()
{
  /* Set all three Sensor types to Touch sensors */
  SetSensorType(SENSOR_1, SENSOR_TYPE_TOUCH);
  SetSensorType(SENSOR_2, SENSOR_TYPE_TOUCH);
  SetSensorType(SENSOR_3, SENSOR_TYPE_TOUCH);

  /* Set infrared power to High, so we can cover longer distance. */
  SetTxPower(TX_POWER_HI);

  while(true) // Loop forever
  {
    if (SensorValue(0)==1) //button 1 pressed
    {
      SendRCMessage(RC_CHANNEL_1, RC_CMD_REV, RC_CMD_FWD);
    }
    if (SensorValue(1)==1) //button2 pressed
    {
      SendRCMessage(RC_CHANNEL_1, RC_CMD_FWD, RC_CMD_FWD);
    }
    if (SensorValue(2)==1) //button3 pressed
    {
      SendRCMessage(RC_CHANNEL_1, RC_CMD_FWD, RC_CMD_REV);
    }
    Wait(5);
  }
}

This of course assumes your Spybotics brick has been configured to RC channel 1. Download the program: rcx2spy_remote.nqc

Share

]]>
https://pbrick.info/2013/10/controlling-a-spybotics-pbrick-using-an-rcx/feed/ 0