Shop OBEX P1 Docs P2 Docs Learn Events
Control Board Via Software — Parallax Forums

Control Board Via Software

NealiosisNealiosis Posts: 2
edited 2008-08-13 18:19 in BASIC Stamp
Hi everyone! I'm been reading like crazy the last week or so working on my project but I was hoping someone could point me in the right direction. All the guides I have read have you write a program in PBasic and upload it to the chip but I need to control the chip with software. I'm a C#.NET programmer so anything along the .NET lines would be great! I'm trying to trap events on various servers and then light LEDs in a sequence for each different event. Is there a tutorial out there that can show me how to control the chip through software running on a PC?

I found this thread:
http://forums.parallax.com/forums/default.aspx?f=5&m=284235

but that person if already way past where I am right now. I'm trying to figure out if I need to build a listener server on the chip and then talk to that from my application or if I can just control the chips I/O voltages directly in my application with no software needed on the ship?

Sorry for all the questions,
Thx

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-13 17:28
    Realistically, you will need to build a "listener server" on the Stamp and talk to it from your application. You cannot directly control the I/O pins from the PC. The Stamp's SERIN / SEROUT statements are commonly used to communicate to a PC using I/O port 16 (which is the programming serial port). You can also use the DEBUG / DEBUGIN statements which do much the same thing. You decide on a command format that fits your needs and write a simple Stamp program that listens for commands and performs them. It's best to have the Stamp function as the master since it's "single threaded" and only listens to the serial port when a SERIN or DEBUGIN statement is being executed. If the PC sends a command any other time, it will be ignored. Typically, the Stamp sends a query to the PC when it's ready for a new command, then waits for a command to be sent from the PC.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2008-08-13 18:07
    Hi, this link might help you a little http://forums.parallax.com/showthread.php?p=671804

    The examples are Visual Basic but you should be able to transpose them over to C# relatively easy. The first example in the thread shows how to send 1 byte of information from a PC to a Stamp. You are going to have to understand PBasic in order to use the information you are sending but this is one building block of many to help you on your way.

    Jeff T.
  • NealiosisNealiosis Posts: 2
    edited 2008-08-13 18:19
    Unsoundcode said...
    Hi, this link might help you a little http://forums.parallax.com/showthread.php?p=671804

    The examples are Visual Basic but you should be able to transpose them over to C# relatively easy. The first example in the thread shows how to send 1 byte of information from a PC to a Stamp. You are going to have to understand PBasic in order to use the information you are sending but this is one building block of many to help you on your way.

    Jeff T.

    WOW! Thanks, this is perfect. I'll wrap the VB.NET code into a static lib (I think it's called Shared in VB) and it will work just fine for my application. Awesome!
Sign In or Register to comment.