Things You'll Need
Instructions
Write out the plan in detail before you start programming. Use whatever system you are familiar with -- flowcharts, pseudocode, pictorial representation with boxes and arrows or just a detailed description in English. The most serious mistake you can make in writing a program is to start without a plan. Work out all the details in an informal way before writing the first line of code. There is programmer's heuristic that captures this idea: "The sooner you start coding, the longer it takes."
Connect a USB cable between the Stamp and a PC and bring up the PBASIC coding environment. Transcribe your detailed plan into PBASIC code. Read over the code carefully. A single typo could wind up destroying expensive equipment if it is not corrected in time. Download the program to the Stamp.
Test the program before installing it in the equipment it is meant to control. It cannot be tested completely outside the environment, but this preliminary test can find some errors without damaging expensive equipment.
Install the stamp and start the serious testing. Do easy things first, and when you do the extreme testing, take all possible safety precautions. For example, if the Stamp is controlling an anti-aircraft gun, the program should prevent the gun from shooting straight up. When you test this, you should use a blank shell.