NXT Train Controller
Posted: 02 Feb 2011, 16:26
Hello!
I have a Lego 9v train, along with a 1.1 NXT. I would like to be cable to combine the 2 items so that the mindstorms works the train (or helps work it).
I have:
1. Used the NXT to power the train forward.
2. Make it run forward until the ultra-sonic (which is beside the track) senses it then the train stops, bang on at the station. Plays 1 sound-wait 10 seconds-Pay another sound then pull off.
3. (on a differnet program to #2.) Make it run forward. When the light sensor senses the level crossing goes down, timer of ~5 seconds starts, train gets through and the crossing comes back up again.
What I really want to be able to do is this: You press the forward button the train moves forward. You press the back button the train goes backward. So if the train was going top speed (forward) and I pressed the back button, the train would slow down one each press until stopped, then start reversing on each press and vice-verca. Also as it is running if the light or ultra-sonic it would do respectivly what I said on 2 and 3. At the same time the display shows what is happening, but that should be the easiest bit.
Displays work like this:
Forward-Forward Slowly/Average/Fast
Stop-Train Stoping/Train Stopped
Backward-Backward Slowly/Average/Fast
Station-Train stopping/Board the Train/Train Leaving
Crossing-Gates Down/Gates Up
I would be extreamly greatful if someone could help me here.
Thank You
I have a Lego 9v train, along with a 1.1 NXT. I would like to be cable to combine the 2 items so that the mindstorms works the train (or helps work it).
I have:
1. Used the NXT to power the train forward.
2. Make it run forward until the ultra-sonic (which is beside the track) senses it then the train stops, bang on at the station. Plays 1 sound-wait 10 seconds-Pay another sound then pull off.
3. (on a differnet program to #2.) Make it run forward. When the light sensor senses the level crossing goes down, timer of ~5 seconds starts, train gets through and the crossing comes back up again.
What I really want to be able to do is this: You press the forward button the train moves forward. You press the back button the train goes backward. So if the train was going top speed (forward) and I pressed the back button, the train would slow down one each press until stopped, then start reversing on each press and vice-verca. Also as it is running if the light or ultra-sonic it would do respectivly what I said on 2 and 3. At the same time the display shows what is happening, but that should be the easiest bit.
Displays work like this:
Forward-Forward Slowly/Average/Fast
Stop-Train Stoping/Train Stopped
Backward-Backward Slowly/Average/Fast
Station-Train stopping/Board the Train/Train Leaving
Crossing-Gates Down/Gates Up
I would be extreamly greatful if someone could help me here.
Thank You