views:

1558

answers:

4

I have an Arduino Duemilanove USB. I have just a single LED wired up to a single port on it. I want to use C# to turn on this LED. Does anyone have a simple example of how to do this? Just the most basic on/off code is what I'm looking for.

On a side note, I know there are some libraries written for .NET communication with Arduino. The ones I've found all use Firmata and I cannot get the Firmata library to work at all with my Arduino, so I'm looking for a straightforward example using just a raw Serial command.

+5  A: 

I think that this link sort of answers your question:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1222229723/8

Dan
+1  A: 

Here are two links doing exactly this which may help:

http://www.vimeo.com/3726170 and http://www.youtube.com/watch?v=GN5GlVWo6sU

They both have source code available.

JonnyBoats
A: 

I think the Firmata project is what you have been looking for.

Firmata is a generic protocol for communicating with microcontrollers from software on a host computer. It is intended to work with any host computer software package. Right now there is a matching object in a number of languages. It is easy to add objects for other software to use this protocol. Basically, this firmware establishes a protocol for talking to the Arduino from the host software. The aim is to allow people to completely control the Arduino from software on the host computer.

Further Resources:

Firmata.Net Project

Arduino/firmata library for Visual C# .NET

Andrew
Was this an auto-generated response or something? I coulda swore OP said Firmata doesn't work at all with his Arduino...
mrduclaw
Firmata was mentioned but just because OP could not get it to work does not invalidated the solution. My answer is here for reference only and may be of use to others if not for mrduclaw.
Andrew
@Andrew, so instead of trying to answer OP's question, you just restate something he all ready mentioned for theatric effect? Sorry, I still don't see the usefulness of this answer given the fact that OP actually mentioned it as the usual way to solve this problem. So if anyone else had a similar problem, they'd all ready get this answer from his question. Further, it doesn't even attempt to answer the question at hand here either.
mrduclaw
A: 

Try setting your baud rate to 57600 instead of the default 115200, and that should hopefully get Firmata working with your Duemilanove. I'm honestly still trying to pick through the Firmata library for Python to get a sense of how it's using the protocol so I can use it over straight serial comms in a project that won't exclusively be using Arduino as an interface.

In the meantime, however, this got Firmata working (path of least resistance).

Nathan