Shop OBEX P1 Docs P2 Docs Learn Events
C# interface — Parallax Forums

C# interface

bboy8012bboy8012 Posts: 153
edited 2006-10-28 22:12 in BASIC Stamp
I have searched on the internet and found the interface for code to interface C# to the BS2, my problem is when I run the software and click led on the led flicks on and goes off, it doesn't stay on like I want it to until I click LED off. I am wondering is that a timing issue, if not what issue could that be here is the BS2 code.

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-28 05:42
    Try these modifications to your PBasic code to start with:

    1. Put a Return statement in the following subroutines: readInput, doAction
    2. Put a Gosub doAction call in the readInput subroutine
    3. You can remove the Pause 1000 lines in ledON & ledOFF if they aren't needed. In this example, it doesn't look like they are, since you aren't performing another action after the pause.

    Post Edited (Kevin Wood) : 10/28/2006 8:08:31 AM GMT
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-10-28 08:48
    Rather than relying entirely on automation, try to learn a bit of PBasic as well.

    These kind of programs tend to make assumptions that are case sensitive and become very buggy.

    In other words, they are good introductory devices. But using PBasic will always be better supported. Just consider how often the C# is going to keep up with the evolution of PBasic without having a significant base of paying customers.

    In the end, Parallax is always be·happy to help you fix the code because you bought the hardware. You are a customer. That also provides you with the PBasic and free downloadable documentation. So you see, you bought the software and the support too.

    Generally top notch programers can easily move between several languages. So, I have been learning C, just to read examples that I can program in the SX-Key assembly language and the Propeller assembly language.

    I have nothing that I really care to maintian in C, C+, C# or C++.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • bboy8012bboy8012 Posts: 153
    edited 2006-10-28 21:41
    Thanks Kevin
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-28 22:12
    Did it fix the problem? Missing return statements will cause weird behavior.
Sign In or Register to comment.