|
Danny's Lego Mindstorms® RCX I/O Multiplexer |
| Home/ Sensors/ Lego proximity sensor |
Disclaimer
This page is not connected with or
endorsed by The LEGO Company. LEGO, LEGOLAND, LEGO SYSTEM, LEGO TECHNIC, DUPLO,
LEGO PRIMO and LEGO MINDSTORMS are trademarks of The LEGO Company.
You can call it RCX Output Expander.
You can call it RCX Output Extender.
You can call it RCX Output Doubler.
Because it can be used also for inputs, I called it
"RCX I/O MUX": RCX input/output multiplexer.
It's incredibly useful and easy to use while programming.
Pardon me, it's really ugly. I didn't have enough LEGO electric plates to sacrifice.
So I must use those horrible screws; I must admit that working on them ( fitting in the 4x6 plate, cutting) was terrifying but, at the end, they allow a good electric contact.
The MUX must be connected to all RCX output ports to obtain 6 independent outputs.
Port A controls motors 1, 2 and 3.
Port C controls motors 4, 5 and 6.
Port B make the channel selection:
No power: motors 1 and 4 move
as you want;
Negative power: relay2 is on,
motors 2 and 5 move as you want;
Positive power: relay1 is on,
motors 3 and 6 move as you want.
In any state, when a pair of motors work, the other are disconnected (no brake function is permitted).
With simple programming, you can get a good multiplexing on motors, so it will seem they are all on.
Here's an example, that makes all 6 motors turn both directions in cycle:
| #define p Wait(10) #define m 23 #define Fwd1(x) { OnFwd (OUT_A); Wait(x); Off(OUT_A);} #define Rev1(x) { OnRev (OUT_A); Wait(x); Off(OUT_A);} #define Fwd2(x) { OnRev (OUT_B); OnFwd (OUT_A); Wait(x); Off(OUT_A);Wait(5);Off(OUT_B);} #define Rev2(x) { OnRev (OUT_B); OnRev (OUT_A); Wait(x); Off(OUT_A);Wait(5);Off(OUT_B);} #define Fwd3(x) { OnFwd (OUT_B); OnFwd (OUT_A); Wait(x); Off(OUT_A);Wait(5);Off(OUT_B);} #define Rev3(x) { OnFwd (OUT_B); OnRev (OUT_A); Wait(x); Off(OUT_A);Wait(5);Off(OUT_B);} #define Fwd4(x) { OnFwd (OUT_C); Wait(x); Off(OUT_C);} #define Rev4(x) { OnRev (OUT_C); Wait(x); Off(OUT_C);} #define Fwd5(x) { OnRev (OUT_B); OnFwd (OUT_C); Wait(x); Off(OUT_C);Wait(5);Off(OUT_B);} #define Rev5(x) { OnRev (OUT_B); OnRev (OUT_C); Wait(x); Off(OUT_C);Wait(5);Off(OUT_B);} #define Fwd6(x) { OnFwd (OUT_B); OnFwd (OUT_C); Wait(x); Off(OUT_C);Wait(5);Off(OUT_B);} #define Rev6(x) { OnFwd (OUT_B); OnRev (OUT_C); Wait(x); Off(OUT_C);Wait(5);Off(OUT_B);} task main () //general motor test1 { while (true) { Fwd1(m); Rev1(m); p; Fwd2(m); Rev2(m); p; Fwd3(m); Rev3(m); p; Fwd4(m); Rev4(m); p; Fwd5(m); Rev5(m); p; Fwd6(m); Rev6(m); p; p; } } |
As you could notice, the #define header is very easy to export, and so programming my MUX is really simple.(pay attention to connect the MUX properly)
When I will get some electric plates, I'll do a new MUX, at least... more nice to look!
For copyright reasons, schematics are not available.