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 program and/or simple:

    Along the highway, all but lost among blatant neon lights flashing ‘Whiskey’ and ‘Dance and Dine,’ are crudely daubed warnings erected by itinerant evangelists, announcing that ‘Jesus is soon coming,’ or exhorting the traveler to ‘prepare to meet thy God.’
    —For the State of Florida, U.S. public relief program (1935-1943)

    His character as one of the fathers of the English language would alone make his works important, even those which have little poetical merit. He was as simple as Wordsworth in preferring his homely but vigorous Saxon tongue, when it was neglected by the court, and had not yet attained to the dignity of a literature, and rendered a similar service to his country to that which Dante rendered to Italy.
    Henry David Thoreau (1817–1862)