Need help accessing pins individually using Visual Studio C++!!

Hi guys,

I'm new to micro-controllers, I need help figuring out how to use pins on Arduino individually, I'm trying to make a simple acquisition system using two or three temperature sensors and then plot their values on a chart, and at the same time have each of these pins displaying the value on a text box, like this:

pin0 -> textBox1.Text
pin1 -> textBox2.Text
pin3 -> textBox3.Text

I'm using Visual Studio C++ 2015, So I already created that program, attached a snap for my in-progress work

And I used this basic sketch on the Arduino:

int _ABVAR_1_sensorValue = 0 ;
int _ABVAR_2_sensorValue2 = 0 ;

void setup()
{
  Serial.begin(9600);
}

// 1(s)= 1000(ms) -> 1000ms/50ms = 20 readings every second

void loop()
{
  _ABVAR_1_sensorValue = analogRead(0) ;
  Serial.print(_ABVAR_1_sensorValue);
  Serial.println();
  delay( 100 );  
  _ABVAR_2_sensorValue2 = analogRead(1) ;
  Serial.print(_ABVAR_2_sensorValue2);
  Serial.println();
  delay( 100 );  
}

So is this done by linking an Arduino DLL to my project (VC++ Solution)??
Or is their a way to use (define) the physical addresses of the pins to have access for them from Visual Studio??

What if I get 4 channel relay module?? Am I gonna be able to have access to these channels (pins) separately??

But is it right to hook up a sensor to a relay?? is the relay gonna return the temp. value??

What about Firmata or Windows Remote Arduino, but I have Windows 7...
Is Firmata usable for pin interfacing??

I thought about using an array that displays the values on one row separated by tab, but anyway I need to do it right, professionally, so I can have a Series on the chart for each pin.

I know I'm asking too much,, Sorry,, So,,,Any ideas guys?

Thanx in advance

So is this done by linking an Arduino DLL to my project (VC++ Solution)??

No. The Arduino does not use dlls. Even if it did, a dll for the Arduino would be useless on the PC.

You are sending anonymous data (why?) to the serial port. A C++ application can read the serial port, and do something (by guessing, apparently) with the data that comes in the serial port.

Or is their a way to use (define) the physical addresses of the pins to have access for them from Visual Studio??

No.

Suppose that you were locked in a room with bars on the door, but, outside there was a friend of yours. Could you figure out a way to turn the lights off outside?

Thanx for ur answer PaulS

No. The Arduino does not use dlls. Even if it did, a dll for the Arduino would be useless on the PC

Sorry if I have't put things straight, but there is a dll for the Firmata protocol called SolidArduino.dll and there are a few examples using C#, but I need examples for C++, I'm not sure probably I can use it.

You are sending anonymous data (why?) to the serial port. A C++ application can read the serial port, and do something (by guessing, apparently) with the data that comes in the serial port.

I did manage to receive data from the serial port, but I need to receive data from different pins separately

Suppose that you were locked in a room with bars on the door, but, outside there was a friend of yours. Could you figure out a way to turn the lights off outside?

haha :slight_smile: I meant using a pre-defined arduino dll/library and reference it in my VC++ solution

I meant using a pre-defined arduino dll/library and reference it in my VC++ solution

Why do you need to? Why can't you send a message to the Arduino, in a form that it understands, and read it's reply? That is all that Firmata is doing, but, by developing your own process, you can still have the Arduino doing other things, like reading accelerometers, gyroscopes, encoders, etc.

Appreciate your help Paul, but I'm not sure I'm following u properly, I was looking for some examples doing exactly what u mentioned, like doing other things simultaneously, anyway if u think I don't need Firmata, can u please post some code on how to do so on the Visual C++

can u please post some code on how to do so on the Visual C++

No, because I do not use C++ to develop applications that talk to the serial port. I use C# for that.

But, you could send "R, 3\n" to the Arduino to mean read digital pin 3. The Arduino can easily collect the data until the \n arrives, when it would parse the stored data and learn what to do. Obviously, the read implies that the Arduino should send the value that it read, so Serial.println() should be used to return the value.

Thanx Paul

Have u seen this: GitHub - SolidSoils/Arduino: C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication

Reference the Solid.Arduino.dll in a C# project and take a look at what it is all about, see if u can put together some kinda winform to list arduino pins individually and get their values displaying on separate labels or textBoxes

Hi guys,
In reference to my question above, I figured it out using this library Arduino <> Firmata <> Visual Basic .NET

Thanks for Andrew Craigie

Now I'm able to use multiple pins individually, attached pic of the program

Capture.JPG