A few people asked to see the subroutines provided by Lego. The 1000 series initializes the system. 1100 series turns bits off. 1200 series turns bits on. Descriptions and code are exactly as described in the instructions. 1000 REM INIT 1001 S=(SLOT NUMBER -- MINE IS 4 -ek):l=49280+S*16 1002 POKE L+3,1 1003 POKE L+2,63 1004 POKE L+1,0 1005 POKE L,0 1006 RETURN "Below is a subroutine which will send the data stored in an array DB(...) to the interface. It is assumed that the elements DB(0) through DB(5) contains 1s and 0s to turn the bits on and off. These data elements are then combined into a single decimal value to be sent." 1100 REM OUTPUT DATA 1101 DB=0: REM INIT DATA 1102 FOR I=0 TO 5: REM CONVERT BINARY DATA 1103 DB=DB+DB(I)*2^I 1104 NEXT I 1105 POKE L,DB: REM SEND DATA TO INTERFACE 1106 RETURN "The following routine will turn on all the bits specified. It has two entry points. If you call it at the beginning (line 1110), you will turn off all the other bits. If you call it at line 1115, you leave the other bits alone. To use this routine, you must first set the required (T(0) to (T(5)) to 1." 1110 REM TURN ON SPECIFIC BITS 1111 FOR I=0 TO 5: REM TURN OFF ALL BITS FIRST 1112 DB(I)=0 1113 NEXT I: REM FALLS THROUGH TO NEXT PART 1115 FOR I=0 TO 5 1116 DB(I)=DB(I) OR T(I): REM TURN ON REQUIRED BITS 1117 NEXT I 1118 GOSUB 1100 1119 RETURN "For example, to turn on bits 3 and 4, without changing the other bits, you could use the following line: T(3)=1:T(4)=1:GOSUB 1115. To turn on bits 3 and 4, and the rest off, use: T(3)=1:T(4)=1:GOSUB 1110. There's also a routine to turn bits on for a set period of time, and another routine to read bits, but I'm not using those right now. A while ago I asked Dan offline how to make a routine to turn specific bits * off *. He explained that the easiest way is to copy the 1115-1119 routine (changing the series to 1200) and change the OR in line '16 to AND. It works perfectly when used one bit at a time.