Shop OBEX P1 Docs P2 Docs Learn Events
comparison code / hlep urgent — Parallax Forums

comparison code / hlep urgent

basic stampbasic stamp Posts: 1
edited 2008-11-23 15:27 in BASIC Stamp
HI,
·hope somebody kindly help to teach me how I program the basicstamp with comparison funtion.

I would like to define one default value, then the actual value could compare with the default value, then slowly to change to the default value, then this action should reflect as sound.

for example, the default value is 30 sec. but the actual value is 40 sec. then when the people with 40 sec. value, it should come out with one sound, but after compare,·there is 10 sec difference, hence the actual value could·take·1 step to change to 30 sec. such as·40, 35, then 30, so·so·sound could be as 40 second·"sound", then 35sec "sound", then··30 sec "sound".

I am prety new on program, hope your expert could give me some example or application which with this comparison funtion. Thanks!

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2008-11-23 12:59
    Start with the Help file and its explanation of the IF-THEN structure. There are several variations of the the IF statement such as SELECT CASE which may be useful as well.

    Its always easier for us to help if you show us the code you've already written.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-23 15:27
    You should download the "What's a Microcontroller?" tutorial (here: www.parallax.com/tabid/535/Default.aspx). It has many examples, explanations, and exercises to work through that illustrate the kind of programming that you are describing.
Sign In or Register to comment.