Shop OBEX P1 Docs P2 Docs Learn Events
Do-Loop Program is not Looping — Parallax Forums

Do-Loop Program is not Looping

VecTenVecTen Posts: 3
edited 2010-05-03 04:32 in Learn with BlocklyProp
I could not find similar problems looking through the site. I spent some time looking so I don't appear to be too lazy.

I am new to programming, but have the HomeWork Board and "What's A Microcontroller?" book. My first programs worked well. I am trying to flash an LED continuously. It cycles once, then freezes. This laptop seems to have a non-standard serial port. Following the instructions, I disconnected the serial cable--still no Loop when I press the reset button. I changed the program by adding the following after the compiler directives:

DEBUG "Program Running!"

The book says this should keep the COM port open? Fascinating! Man, this is great stuff!

This seems to be a laptop problem, not Stamp. I appreciate any help.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-28 23:11
    1) Any time you have a question about a program, please provide a listing of your program. Do not use cut and paste. The forum software will strip out some of your formatting. Use either the "code" tags ([noparse][[/noparse] code] and [noparse][[/noparse] /code] without the extra space) or the Attachment Manager that you get by using the Post Reply button instead of the Quick Reply box.

    2) You may have a weak battery. That's a common cause of programs starting to run then hang or reboot.
  • VecTenVecTen Posts: 3
    edited 2010-04-28 23:32
    Dr. Green:

    I appreciate your reply. I have uploaded file and fresh battery. And I accidentally pushed your ignore button to find out what this button was! Ouch!
    For your information, I have it on good authority that at the Roman Amphitheatre a "thumbs down" sign meant the Gladiator would live to fight again.

    I don't see that attachment opening, maybe I just write it out like I see it.

    'What's a Microcontroller - LedOnOff.bs2
    'Turn an LED on and off. Repeat

    ' {$STAMP BS2}
    '{$PBASIC 2.0}
    DEBUG "Program Running!"

    DO

    High 14
    Pause 500
    LOW 14
    PAUSE 500

    LOOP

    Post Edited (VecTen) : 4/29/2010 12:07:38 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2010-04-28 23:43
    You need to specify PBasic 2.5. The DO / LOOP statement doesn't exist in version 2.0. I'm surprised you didn't get an error message.
  • VecTenVecTen Posts: 3
    edited 2010-05-03 04:32
    Dr. Green:

    Thank you. I am making good progress now. This was a simple blunder on my part. I'm on my way to becoming the next Dean Kamen! Let me know if I can do anything for you here on the East Coast.
Sign In or Register to comment.