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 work of Henry James has always seemed divisible by a simple dynastic arrangement into three reigns: James I, James II, and the Old Pretender.
    Philip Guedalla (1889–1944)

    Mead had studied for the ministry, but had lost his faith and took great delight in blasphemy. Capt. Charles H. Frady, pioneer missionary, held a meeting here and brought Mead back into the fold. He then became so devout that, one Sunday, when he happened upon a swimming party, he shot at the people in the river, and threatened to kill anyone he again caught desecrating the Sabbath.
    —For the State of Nebraska, U.S. public relief program (1935-1943)