#rcx

2025-06-04

Random thought: #LEGO #Mindstorms #RCX(!) to LEGO #DUPLO adapter plate/housing.

2024-08-05

Dear chaos bubble,

during #37C3 there were two scheduled meetups: "Bällebad-Sortiermaschine // Let’s build a ball pit sorting machine (MeetUp)
flair" - Did any plans turn up from this?

Also, I could provide you with some oldschool #LEGO #Mindstorms #RCX (from the first generation).

#38C3 #bällebad #sortiermaschine

2024-07-22

Wooohoo. I've been able to talk to my #LEGO #Mindstorms yellow programmable #RCX brick. This time via the infrared USB(!) tower (and not the serial one)... via WebUSB in the browser. This is lacking some robustness still.. but loading firmware and user programs compiled from NQC doesn't feel to far away. Just pushed the experimental code to the #WebPBrick git repository.

Could still need some help getting my JavaScript right though (less hacky, more robust): chaos.social/@maehw/1128320147

Successful attempt... but the RCX didn't have any firmware loaded. This is still a success!Another successful attempt... with pre-loaded firmware on the RCX. This time we can even see the battery level and hear a sound from the RCX.

(Pre-loading the firmware was done with the LEGO serial infrared tower in the meantime. LEGO USB tower yet to come.)
2024-07-18

I got a beep out of my #LEGO #Mindstorms #RCX programmable brick. Basically not a big deal... BUT: this time using the *USB* infrared tower and not the *serial* one. And on a 64-bit system. Using the WebUSB API. This is possible thanks to @HangryDave's InfraredBrickTower project, more USB analyzing and reading the device's spec docs again. So firmware update and programming in the #WebPbrick IDE seems to be doable. Pushed the hacky PoC to the github repo, check out src/communication/webusb.htm.

Screensot with console + UI output from the WebPBrick USB PoCScreenshot of USB analysis with Saleae LogicScreenshot of output that shows complete USB transactions with data that is sent to the RCX via the USB IR tower
2024-07-15

Wrote a "high level USB decoder" which sits on top of Saleae's USB LS/FS analyzer so that I can see the really relevant data. Should help getting me the #LEGO #USB Infrared Tower for the #Mindstorms #RCX analyzed better... and maybe provide #WebUSB support on #WebPBrick some day. Sometimes you cannot to see the wood for the trees. (I was surprised recently that this saying could be translated from German to English 1:1.) Planning to open source the tool.

#hardwarehacking #reverseengineering

The tool's intermediate output: a bunch of USB transactions being displayed.

A boring excerpt (won't be fun to read or hear I guess):


===> Transaction: UsbTransaction(Start: 8.55790076, Type: SETUP, Addr.: 11, EP: 0, Success: True, bmRequestType=0b11000000, bRequest=0x02, wValue=[1, 2], wIndex=[0, 0], wLength=[232, 3])
===> Transaction: UsbTransaction(Start: 8.55849542, Type: IN, Addr.: 11, EP: 0, Success: True, Data: [4, 0, 0, 2])
===> Transaction: UsbTransaction(Start: 8.55873182, Type: OUT, Addr.: 11, EP: 0, Success: True, Data: [])
===> Transaction: UsbTransaction(Start: 8.56020846, Type: OUT, Addr.: 11, EP: 2, Success: True, Data: [85, 255, 0, 210, 45, 0, 255, 0])
===> Transaction: UsbTransaction(Start: 8.56820842, Type: OUT, Addr.: 11, EP: 2, Success: True, Data: [255, 210, 45])
===> Transaction: UsbTransaction(Start: 8.5762084, Type: OUT, Addr.: 11, EP: 2, Success: True, Data: [85, 255, 0, 210, 45, 128, 127, 0])
===> Transaction: UsbTransaction(Start: 8.58420836, Type: OUT, Addr.: 11, EP: 2, Success: True, Data: [255, 82, 173])

===> Transaction: UsbTransaction(Start: 12.12311558, Type: SETUP, Addr.: 11, EP: 0, Success: True, bmRequestType=0b11000000, bRequest=0x02, wValue=[1, 2], wIndex=[0, 0], wLength=[232, 3])
2024-06-23

Another day playing around with the #LEGO #Mindstorms #RCX:

This time, I've reactivated some #brickOS demo files. I just found out that I had installed the toolchain on my Debian-based laptop earlier but never really tried it out. It works!

You can now let a GitHub action build brickOS user programs for you: github.com/maehw/BrickOsTest

More details here:
maehw.wordpress.com/2024/06/23

👀 @luis_in_brief you migt be interested. :awesome: - Can you confirm that the `dll` download utility is based on LNP?

2024-06-22

I am currently testing the #LEGO #Mindstorms #RCX analog clock. The NQC source code distributed with the original model does not compile in #WebPBrick's #WebNQC. Not too wild, as the main logic has been commented. I've added a touch sensor to initially set the clock during startup. And the light-based rotation sensor code has been replaced by code that handles the normal rotation sensor. 1/2

chaos.social/@maehw/1125350028

Original NQC code with compile errors in WebPBrick

The code is:
```

#define LIGHT		IN_1
#define MOTOR		OUT_A

#define THRESHOLD	50

#define PowerDownDelay(minutes)		asm { 0xb1, (minutes) }

int curr_watch;
int old_watch;
int tmp;
int state;

sub step
{
	if (state == 0) {
		if (LIGHT < THRESHOLD) {
			Rev(MOTOR, 1);
			while (LIGHT < THRESHOLD);
			Off(MOTOR);
		}
		state = 1;
	} else {
		if (LIGHT > THRESHOLD) {
			Rev(MOTOR, 1);
			while (LIGHT > THRESHOLD);
			Off(MOTOR);
		}
		state = 0;
	}
}

task main
{
	Sensor(LIGHT, IN_LIGHT);

	/* Uncomment the next line to prevent the RCX from
	   falling asleep after the default 15 minutes.
	   Supplying power from an AC adapter is recommended. */
	/* PowerDownDelay(0); */
	Display(0);
	old_watch = Watch();
	state = 0;

	while(1 == 1) {
		curr_watch = Watch();
		if( curr_watch != old_watch ) {
			old_watch = curr_watch;
			/* We only want to step four times each five
			   minutes, for 48 steps per hour.  Don't
			   step on minutes that are multiples of 5. */
			tmp = (curr_watch / 5) * 5;
			if (tmp != curr_watch) {
				step();
			}
		}
	}
}

```Block based program which I adapted to my needs. The generated NQC code reads:

```
int current_watch, old_watch, old_rotation, current_rotation;


task main() {
  SetSleepTime(0);
  SetSensor(SENSOR_1, SENSOR_ROTATION);
  SetSensor(SENSOR_2, SENSOR_TOUCH);
  SetPower(OUT_C, 1);
  SetDirection(OUT_C, OUT_FWD);
  On(OUT_C);
  while (!(SENSOR_2 == 0)) {
  }
  Off(OUT_C);
  ClearSensor(SENSOR_1);
  SelectDisplay(DISPLAY_WATCH);
  old_watch = Watch();
  start watch;
}

task watch() {
  while (true) {
    current_watch = Watch();
    if (current_watch != old_watch) {
      old_watch = current_watch;
      PlaySound(SOUND_CLICK);
      if (current_watch % 5 != 0) {
        old_rotation = SENSOR_1;
        current_rotation = old_rotation;
        On(OUT_C);
        while (current_rotation == old_rotation) {
          current_rotation = SENSOR_1;
        }
        Off(OUT_C);
      }
    }
  }
}
```The generated NQC code compiles to 245 bytes of LEGO RCX bytecode. The image shows the NQC code and logs for compilation inside the IDE and bytecode transfer to the RCX.
2024-06-20

I've been able to fix my precious #LEGO #Mindstorms rotation sensor for the #RCX. It had the flaky wire syndrom. I then also used #WebNQC (Blockly-based) visual programming to generate some test code. I can now slowly move the axle and play sound dependent on the direction of rotation. A full circle gives 16 impulses.

#WebPBrick #robotics #stem #hacking #making

The test setup: the yellow programmable RCX brick, attached is the rotation sensor in blue with a black axle that can be turned manuallyThe WebNQC IDE: on the left you see the visual WebNQC program with sensor initialization and the program logic - on the right you can see the generated NQC code.

The code reads as follows:
```
int rot, rot_new;


task main() {
  SetSensor(SENSOR_1, SENSOR_ROTATION);
  ClearSensor(SENSOR_1);
  rot = SENSOR_1;
  rot_new = rot;
  while (true) {
    rot_new = SENSOR_1;
    if (rot > rot_new) {
      PlaySound(SOUND_UP);
    } else if (rot < rot_new) {
      PlaySound(SOUND_DOWN);
    }
    rot = rot_new;
  }
}
```Compiling the generated NQC code in WebPBrick's main IDE. On the left you can see the generated code once again - and on the right side you can see log output from the RCX connection, the build log and the log for a successful transfer of the compiled bytecode program to the RCX.
2024-06-17

After a long time, I've written another blog post. It's about the recent fun I had with the #LEGO #Technic + #Mindstorms (#RCX) plotter. I've also published my #NQC code there.

maehw.wordpress.com/2024/06/17

2024-06-13

Another iteration of the #LEGO #Technic + #Mindstorms #RCX based pen #plotter – based on set 8094. I finally understood how to retain the pen as intended by the original instructions - must have missed that before. Also added the "pen up/down" feature (another motor) - and this is why you do no longer see the inter-connecting lines from my last post. But, the pen is wobbly... and so are the lines now. Not too happy with this result. But it works. Used #WebPBrick + #NQC.

chaos.social/@maehw/1126044551

The LEGO Technic + Mindstorms plotter in mainly yellow yellow and black bricks.

In front a white sheet of paper with the following wobbly words on it written in dark blue:

HELLO
WORLDPretty crowded yellow programmable Mindstorms RCX brick - all three sensor input ports 1+2+3 are used (actually two ports are used twice; the double usage is only visible for the middle port #2 in this picture) and all three motor output ports A+B+C are also used. On the buttom left of the RCX, you can see a touch sensor which starts calibration and print.Top view of the modified + extended LEGO 8094 plotter model. No LEGO Technic Control Center is used - but the Mindstorms RCX brick from the previous image.
2024-06-12

Found some more free time to work on the #LEGO #Technic + #Mindstorms #RCX based pen #plotter – based on LEGO set 8094. Thanks for pointing me to the Commodore 1520 plotter from where I took the encoded letters of the font from ROM and converted it to segment movements. The font can by the way be found as "FifteenTwenty" for the computer ‐ which helped me to have a reference. Still need to add a "pen up/down" feature and fix other issues... but it works. Kinda.

Modified plot where I retraced the actual font with a thicker light blue marker. The text reads:

HELLO
WORLDUnmodified plot made with a thin purple marker
2024-06-09

Hey, not too bad! The #LEGO #Technic plotter now basically also works with a #Mindstorms #RCX programmable brick. I've added a third switch for control (start calibration, start drawing) — so that you can calibrate without the own down. The L shape shows two half segments north/south (width) and two half segments east/west (height). The length of these segments is based on endstop calibration – basically two timer values. Next step would be to design something nicer.

chaos.social/@maehw/1125881192

Plotter in its home position, a big red L shape plotted on white paperThe same plotter from a slightly different perspective — and this time not in home position (top left) but bottom leftThe yellow programmable RCX brick (Mindstorms) with its three sensor ports in full use and also two output/ motor ports connected
2024-06-09

First idea how the plotter of the #LEGO #Technic 8094 set could be improved... or extended to be controlled with a #Mindstorms #RCX: I've placed four touch buttons as end stop detections — two on each axis. The RCX has three sensor ports but as the motor direction is a configuration thing — it should be okay to have two switches in parallel (logically OR'ed) at one port. Let's see what the cabling will look like. This setup would allow to home the pen automatically and maybe also to calibrate.

LEGO Technic plotter model from above, having four additional touch sensors (the set is from 1990, whereas the RCX has been released in 1998)
2024-06-08

Got me the #LEGO #Technic 8094 set. It includes a famous plotter model. After assembly, I let some kids play around. I am planning to connect it to a #Mindstorms #RCX instead of the Technic Control Center. Some neat ideas went into this set.

Plotter model from above and some scribblesPlotter model from the side and some scribblesThe Technic Control Center with some buttons and a D pad to control two motors simultaneously
2024-05-31

I've rebuilt Ben Williamson's "analog clock" #LEGO model which uses the #Mindstorms #RCX. Unfortunately, I do not have the fiber-optic component which he had used as rotation sensor. The rotation sensor I have still needs have its broken wire fixed. The clock gear defines a ratio so that the it needs to be driven with 48 discrete steps per hour (4 out of 5 minutes). Its programmed in #NQC. Mike Brandl has shared the PDF manual for this ancient technology on his website: lego.brandls.info/legbau.htm

The clock construction with the yellow programmable brick on top, looking slightly different than the original build.A look from the top into the opened model so that you can see the gears.
2024-05-28

Successfully dumped the #LEGO #Mindstorms #RCX' ROM. This is nothing special and has been done ~25 years ago, see mralligator.com/rcx/#Rom - but I may have been the first one doing it with bytewise with pbForth and a Python script (pyserial). Unfortunately, I stored every byte twice. :thisisfine: Of course, I also did not avoid some minor pitfalls before (e.g. trying to dump 16-bit signed(!) HEX numbers with minuses before). 🤔 🤓

#reverseengineering #hardwarehacking #retrocomputing

A visual hex dump with every byte being repeated. You can see the string "DDoo yyoouu bbyyttee,, wwhheenn II kknnoocckk??" in between.
2024-05-26

TL;DR: It works! I've got a #Forth interpreter (#pbForth) running on one of my yellow #RCX programmable bricks. CC @rhempel

Wow... it seems that I was too narrow-minded - or too uncritical. 2400 baud, 8N1 did not work - that's the configuration which I read in at least one (if not two) book(s). It may have been correct in the past.. but adapted to 8O1 later - which is the same configuration as LEGO's original RCX #Mindstorms firmware. However, I do not know what version this is...

Serial terminal input and output with several typos in between - the Fourth interpreter running on the RCX echoes several "OK" messagespbForth firmware download from a slightly modified version of WebPBrick running locally. The download was successful even though the IDE shows two error messages.
2024-05-03

I am happy to announce: 🌐 🧱 💻 WebPBrick v0.2.0 is out. 🎉

You can now use the web-based visual programming editor called BlockNQC to generate Not Quite C (NQC) code:
webpbrick.com/nqc/blocknqc/
(It's based on Google's Blockly.)

The code can then be re-used in the WebPBrick IDE: webpbrick.com/ide/ (compile + download to the #LEGO #Mindstorms yellow #RCX brick)

The source code is on GitHub: github.com/maehw/WebPBrick

The website webpbrick.com/ has also been updated.

A screenshot from https://webpbrick.com/nqc/blocknqc/ - the web-based visual programming editor called BlockNQC with colorful blocks on the left side and generated NQC code on the right sideA screenshot from https://webpbrick.com/ide/ - where the generated NQC code is pasted and compiled. The code is shown on the left side, the generated bytecode for the LEGO MINDSTORMS RCX brick on the right side.
2024-04-30

I am on a long train journey and had plenty of time to work on WebPBricks - the web browser based IDE for the LEGO Mindstorms RCX (the yellow programmable brick of the first Mindstorms generation). The goal was to get started in developing a block based programming frontend - and I am quite happy with these intermediate results (based on Blockly). Not published yet... but the generated code compiles successfully.

#LEGO #Mindstorms #RCX #WebPBricks #WebNQC #WASM #robotics #robots #stem #pbrick

Block-based programming for the LEGO Mindstorms RCX with custom Blocks in Blockly + custom code generation snippets

Blocks of different colors for different things (e.g. driving outputs, reading the input sensors, transmitting IR messages, starting parallel tasks, playing sounds, etc.)The generated NQC codeCompiling the generated NQC code with WebNQC (in the WebPBrick web IDE)Original NQC source code `bugbot1.nqc` by Dave Baum and R. Zurcher (as tracked in the WebPBrick git repository; Freeware License, some rights reserved) - I've used it as a template for the block based visual program and added some other colorful blocks
2024-04-22

Hi @rhempel. I might be digging in some real ancient #LEGO #Mindstorms gold for the #RCX pbrick. But I got curious and want to try out #pbFORTH. Somebody put a GitHub repository online here: github.com/BrickBot/pbForth/tr -- can you guess if `pbSource/pbforth.srec` or `pbFirmware/pbforth.srec` is newer? Can you recommend some tutorial to get started - or a good starting point on your website from back then being stored by web.archive.org?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst