Shop OBEX P1 Docs P2 Docs Learn Events
What's a Microcontroller! — Parallax Forums

What's a Microcontroller!

PhyxPhyx Posts: 4
edited 2009-01-19 21:53 in Learn with BlocklyProp
Hello: I'm new to this forum, I believe you need a section called Newbie; or maybe stupid. I recently purchased What's a Microcontroller, I started from the beginning, by downloading the latest Stamp editor IDE ver # 2.5, run on Windows Vista. As I progressed through the activities I stumbled on the DO - LOOP command page 49.. I can run this program however it will not loop?

' {$Stamp BS2}
' {$PBASIC 2.5}

DO

HIGH 14
Pause 500
LOW 14
PAUSE 500

LOOP


When this code is run, the led lights for the period set in statement 2 and then off and never turns back on? I tried using another method to loop with goto do, and the exercise works as it is was intended? I've invested 4 hours into this before asking for help! This must be real simple as I'm not new to programming; can someone help with this problem?

Thanks Much

Ken

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-19 05:44
    There's nothing wrong with what you've written in your message. There must be something else wrong. Could your battery be low? Could what you're compiling be different from what you've posted somehow?
  • PhyxPhyx Posts: 4
    edited 2009-01-19 16:36
    Thanks for the reply Mike

    It was a cut and paste! One thing that I do see, is that the DO & LOOP are in black not blue? Using the Stamps in class ver. #1 with the BS2 module, also a integrated BS2 stamps in class board with the same results. Also tried a BS2P Stamp in the Home work board same result after the editor changed the stamp too BS2P.

    Thanks Much

    Ken
  • PhyxPhyx Posts: 4
    edited 2009-01-19 16:40
    I forgot to let you know, the battery is new and also used with power supply with same results?

    Thanks

    Ken
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-01-19 16:47
    Hello Ken!

    It appears that if your PBASIC reserved words DO & LOOP are black and not blue, the compiler may be reading PBASIC 2.0 and not PBASIC 2.5. To verify that your are using the correct compiler directive, click the gear icon labeled "2.5" in the top toolbar and see if this fixes your problem.

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen

    Parallax Education Associate
  • PhyxPhyx Posts: 4
    edited 2009-01-19 21:53
    Hello Jessica

    Yep that is what it was, somehow the editor was in 2.0 not 2.5!! Thanks very much, I knew that it would be something simple and it was. This was an educational moment!

    Thank you again Jessica, and many thanks to Mike.


    Ken
Sign In or Register to comment.