Author Topic: C# + Arduino  (Read 12030 times)

0 Members and 1 Guest are viewing this topic.

Offline Getherer

  • Peasant
  • *
  • Posts: 52
  • Cookies: 4
    • View Profile
C# + Arduino
« on: February 27, 2013, 04:12:17 pm »
Hey guys,

I am currently undertaking an assignment from university which requires me to connect arduino to a software written in c#.
I am meant to send off data from arduino's outputs into a textboxes in c#.
I am quite struggling with this as I never had any experience in this kind of work, all I know is that I need to use SerialPorts... it has to be connecting throughout the COM port.
I have played a little bit with it so far and I made a very simple output in textbox, however I need to connect three different components: pulse sensor, GSR and temp sensor and all of them need to send outputs to the program. I could not get it to send more than just one output, not quite sure how to make the arduino and program distinguish different components and their outputs.


Does anybody know any good tutorials that I could go through or has anyone got any advice?


Thanks for help

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: C# + Arduino
« Reply #1 on: February 27, 2013, 05:55:23 pm »
Your basically writing your own protocol. You decide how to send data, how to seperate data, and decided when to stop reading data. Formatting is all up to you. This is if you use Serial.write

For what you want to do, you will use Serial.print and Serial.println, you need to learn the diff between them.
Here is some examples from our fair LadyAda
http://www.ladyada.net/learn/arduino/lesson4.html
>>>import this
-----------------------------