For a very simple example of switching a pin, see the "Blink" example coming with Arduino IDE. RepRap firmwares are quite a bit more sophisticated, though, usually the result of at least a full man-year of coding.
↧