May 11, 2024, 08:03:49 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Need Program Fix

Started by Lindiur, October 31, 2009, 10:57:51 AM

Previous topic - Next topic

BigRez

December 02, 2009, 03:51:42 PM #15 Last Edit: December 02, 2009, 04:16:21 PM by bigrez
* is the multiplication operator and yes, < is the less-than operator.  You'll find those on page 110 and 232 respectively in the PBasic Syntax and Reference Manual.  If you don't have that yet, download it from the Parallax web site. ( http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf)

As Jon explained, he's taking a cumulative variable (timer) and adding 5 to it (for the 5ms pause) then MULTIPLYING it by the trigger value (zero or one.)

In the next example, pos is a variable representing the servo position; it will hold the position value from a value of 60 through 240 increasing by one each time through the loop.  The 19ms pause is included because the servo needs to be refreshed every 20ms - Jon would do a much better job explaining why. :)

JackMan

Hey, thanks for that link, that's what I need. Holy crap.....504 pages.  :o

JonnyMac

Keep in mind that there is a help file connected to the BASIC Stamp editor.

BTW... this thread has really gone off topic -- it has in fact been hijacked.  Please, keep the discussion relative to the original content.  If you want to discuss programming in general, please start a new thread in the Programming Techniques section.
Jon McPhalen
EFX-TEK Hollywood Office