Not Quite C - Simple Program Example

Simple Program Example

A simple test program written in NQC for an RCX with a motor connected to output port A could look like this:

task main // main program { SetPower(OUT_A, OUT_FULL); // turn on motor A at 100% power OnFor(OUT_A, 200); // let the motor run for 2 seconds, then turn it off }

Thus, motor A will go at full speed for two seconds before being turned off.

Read more about this topic:  Not Quite C

Famous quotes containing the words simple and/or program:

    The old-fashioned idea that the simple piling up of experiences, one on top of another, can make you an artist, is, of course, so much rubbish. If acting were just a matter of experience, then any busy harlot could make Garbo’s Camille pale.
    Helen Hayes (1900–1993)

    The cowboy ... is well on his way to becoming a figure of magnificent proportions. Bowlegged and gaunt, he stands as the apotheosis of manly perfection. Songs, novels, movies, magazines, and operettas have made the least inquiring of us well acquainted with his extraordinary courage, unfailing gallantry, and uncanny skill with gun or lariat. The farmer, meanwhile, sits stolidly on his tractor, bereft of romance and adventure.
    —For the State of Kansas, U.S. public relief program (1935-1943)