NUE Ours Putting the e Spotlight on BASIC Stamp Projects, Hints, and Tips Stamp Applications Ping | See You [used to work for a man named Bob who insisted — and quite frequently — that most of us needed to be exposed to the same piece of information five to seven times before that information could be absorbed. | didn't always agree with Bob's philosophy, but in case he wos right, | thought we'd work through the mysteries of conditional compilation again.
1, rapist ist */ Scale raw dist / 2 The code starts by making the output bit of the trigger pin 0, and the reason for this is that PULSATE makes the trigger pin an output, toggles its state, delays, and then toggles that pin back to the original state. Since the Ping module is looking for a low-high-low pulse to trigger the measurement, presetting the pin to 0 makes this happen. After the trigger is sent, PULSING is used to measure the width of the echo pulse.
UT5% Savors | | Debug Schnapps ~ J": Debug Fulton Nonappearance | | +. Dis Detestation © fee Advertising, +1. Stickleback bop © pon LB elan 5 SEE Des WR ond Setlings\jusliamsy ‘Mode Directories: BH oe i [Bee CA. \Willemstad DocumentstPasaliaABS2 account for the fractional units when using the BS2sx, PBS, or Bespeak. For review, works like multiplication, but in units of 1/256, To determine the various values for Scale, we multiply the PULSING units by 256 and take the (rounded) integer result.
The most comment issue among BASIC Stamp users when moving from module to module is with RESIN and SEROUS.
| NUT$8 Voids SEQUESTER Zed, Baud, {DEC temperature] Where else might conditional compilation come in handy? How about program debugging? There is an instruction called #DEFINE that can help in this regard. For example: DEFINE Debugging = 1 While developing and troubleshooting an application, we can do this: . DEC value, CR in as many places in the program as we need.