What's the target environment for the code?

Jun 16, 2010 at 11:46 AM

Hi guys,

What is the target environment for the code?  Is it just to run on Windows and communicate to an Arduino (which you code up separately in the Arduino IDE)?  Or is it to develop the code that will be compiled and uploaded to the Arduino?  

Assuming it's the former, you still have to write your own Arduino code to receive the comms from your PC based C# program and deal with it accordingly?

 

Coordinator
Jun 16, 2010 at 3:24 PM

Hi callagga - 

It works like this:

1. Find the StandardFirmata sketch that ships with the Arduino IDE and upload it to the Arduino. 

  • Once you've done that, the Arduino starts listening for instructions on its serial port. The instructions come in the form of messages that conform to the Firmata protocol.

2. Write a PC application using the Rhyduino library.

  • The PC application runs on the PC and sends instructions to the Arduino over the serial port that the Arduino is connected to.
  • Depending on what instructions you send to the Arduino it may start sending messages back to you. These messages also conform to the Firmata protocol. The Rhyduino library receives the messages, decodes them, and notifies your application my raising an event. The event contains the raw and decoded message data.

With this method, you don't have to write any Arduino code and none gets automatically loaded onto it. That StandardFirmata sketch that you load initially just makes it a slave to your PC. Additionally, with this process, your PC application can control any number of Arduinos simultaneously. 

You didn't ask, but I'll also mention that you don't have to connect the PC to the Arduino with a USB cable. Any method for making a serial connection between the two is acceptable. For example, in a previous version of the library I had it running with XBee wireless modules, so my PC was wirelessly controlling an Arduino in the other room.

I prefer to code in C#, but your PC application could be written in any .NET language. For example, if you prefer to write in Visual Basic or Managed C++, then either of those would work. Heck, you could even use Windows PowerShell scripts if that was your thing. My goal is to allow a .NET programmer to control the Arduino using the language that they're comfortable with without having to learn a new language and IDE (the Arduino IDE).

Thanks for looking into it and inquiring about it. If this is what you were looking for, let me/us know how your experience goes. The more info and feedback I get, the better I can make the library.

- Rhy

Jun 16, 2010 at 9:06 PM

thanks Rhy,

By the way would Rhyduino help out in any way re offering an emulator for an Arduino?  That is say you wanted to write & test Arduino code that you were going to upload into one of the devices (as opposed to running it on the PC to control one that is connected) but you didn't have the unit at hand?

 

Coordinator
Jun 16, 2010 at 9:59 PM

Rhyduino comes with a Mock Arduino that you could use in place of an Arduino for testing Rhyduino code, but it doesn't sound like that's what you're looking for.

I haven't used it, but it looks like the http://www.visualmicro.com/ project might do what you're looking for. The guy running that has implemented many of the Arduino libraries on a PC so that you could write PC code that is identical to what you'd put on the Arduino, get it all debugged, and then transfer it to the physical hardware. At least, that's my understanding of it. 

- Rhy