[home]
[about]
[morris]
[pockets]
[email]
The Mines at Ria

...I hacked a tiny piece of test code from the QuAD stuff and away we went. I'm reproducing my code here, not because it's clever, but because it's easy. This piece of code does what the forwards and backwards thing on the CD does. No more than that. All I was doing was testing the chassis. But you should be able to see exactly what it's doing and then you'll know whether nqc is for you.

The Proof of Concept
Powered by NQC

...or back to the story...


/* the driver software for proof of concept for Ria, my beamrider.
   At this stage, all it does is move backwards and forwards while
   I get the bugs out of the chassis and try to reduce the parts count... */

#define DRIVE   OUT_C

/* Ria has a drive motor on the "rear" wheel, geared two to one; not ideal
   but without an idler gear I can't get the motor and closer to the wheels
   and still keep it within the footprint of the chassis... */

task main()

{
   SetPower (DRIVE , 1);

   // start the main loop

        while (true)

        // it's a test - switch off to stop...

        {
           movefwd ();
           moveback ();
        }

        Off (DRIVE);
       // just in case... 
}

sub movefwd()

{
// up the track
        OnFwd (DRIVE);
        Wait (300);
        Off (DRIVE);
        Wait (100);
}

sub moveback()

{
// and back again
        OnRev (DRIVE);
        Wait (300);
        Off (DRIVE);
        Wait (100);
}

 

text copyright© Andy Anderson, 1999-2001

LEGO and LEGO MINDSTORMS are trademarks of The LEGO Company, which does not endorse or support this independently produced page.

[home]  [pockets]  [mindstorms]  [tour]