Arduino - Serial Communication Visual Studio

This article will show how to communicate between Arduino and Visual Studio through COM (UART) port.

Mar 3, 2017

62488 views

25 respects

Components and supplies

1

Arduino UNO

1

UTSOURCE Electronic Parts

Apps and platforms

1

Visual Studio 2015

Project description

Comments

Only logged in users can leave comments

Image
Image

Anonymous user

2 years ago

Bonjour à tous Très bon projet et merci pour le partage. Au faite je fait un projet qui n'est pas loin du votre. Ce que j'ai fait c'est créer 2 boutons et 4 textbox dans visual c Ce que je souhaite avoir c'est quant j'appuis sur le premier bouton il envoie le contenu des 3 premiers texbox à arduino et me l'affiche sur le moniteur série et si j'appuis sur le 2em bouton, il envoi le contenu de texbox 4 et l'affiche sur le moniteur série de l'arduino Mon problème c'est que quant j'appuis sur le bouton 2 l'interface bug Merci de me donner un coup de pouce si vous avez une idée de ce qui cause le bug Question : est il possible d'envoyer les données visual c vers arduino via un port série autre que tx et rx ?

Image
Image

Anonymous user

2 years ago

Hi, I've just read your tutorial. I think I even found it somewhere else on the web. Are you willing to make a step by step tutorial like this for a universal app?

Image
Image

Anonymous user

2 years ago

Hi, I have downloaded and unzipped your Arduino code from Google Share. Ifound the ino file, compiled it and sent it to the Arduino Uno board succesfully. I have also downloaded and unzipped your Visual Basic/Studio file but I do not know what I have to do with those files. Therfore I have added all lines from the screen manually. I get 58 Errors, mostly syntax errors or not declared errors. I think that your syntax for Studio 2015 is not compatible with the version of 2017 (v. 15.7.5). Do you have any idea what I am doing wrong? And what do I have to do with the zipped file WindowsFormsApplication3?

Image
Image

Anonymous user

2 years ago

Very good project. There's good documentation on operating the serial port on the Arduino end, but not a lot of good and current help for getting a serial port up and running on the PC with Visual Studio C++, especially since with VS 2017 you can't create a windows form project directly (you have to go through a lot of detailed steps to indirectly create a form). Fortunately, you provided a VS C++ project that had the form details already loaded, and the project almost ran perfectly first time. Two problems: 1) the COM port on the PC could be almost anything (mine was COM16), and 2) the COM port on the PC wouldn't open when the form opened. I worked around that by creating a second button on the form, and moving the serial port open and timer start commands to the click event for this second button. So to open the port I just click this "open" button. Works fine. Thanks for a great project and great code. I'm off to a great start with PC-Arduino serial communications. Ray Kimber

Image
Image

whitebank

2 years ago

Glad to hear your comment. I just make project to run, it's not so fine. Modify it if you see any problem for easy using. Don't forget to visit my blog for more project: http://engineer2you.blogspot.com/

Image
Image

Anonymous user

5 years ago

Bonjour à tous Très bon projet et merci pour le partage. Au faite je fait un projet qui n'est pas loin du votre. Ce que j'ai fait c'est créer 2 boutons et 4 textbox dans visual c Ce que je souhaite avoir c'est quant j'appuis sur le premier bouton il envoie le contenu des 3 premiers texbox à arduino et me l'affiche sur le moniteur série et si j'appuis sur le 2em bouton, il envoi le contenu de texbox 4 et l'affiche sur le moniteur série de l'arduino Mon problème c'est que quant j'appuis sur le bouton 2 l'interface bug Merci de me donner un coup de pouce si vous avez une idée de ce qui cause le bug Question : est il possible d'envoyer les données visual c vers arduino via un port série autre que tx et rx ?

Image
Image

Anonymous user

7 years ago

Hi, I have downloaded and unzipped your Arduino code from Google Share. Ifound the ino file, compiled it and sent it to the Arduino Uno board succesfully. I have also downloaded and unzipped your Visual Basic/Studio file but I do not know what I have to do with those files. Therfore I have added all lines from the screen manually. I get 58 Errors, mostly syntax errors or not declared errors. I think that your syntax for Studio 2015 is not compatible with the version of 2017 (v. 15.7.5). Do you have any idea what I am doing wrong? And what do I have to do with the zipped file WindowsFormsApplication3?

Image
Image

Anonymous user

7 years ago

thank you for yourtutorial. I downloaded both project VS and arduino but it doesn't work. It keeps forever waiting data from arduino board. Can it be any problem about end-line char (\\,n, \ , etc...)? How can i fix it? thank you antonio

Image
Image

raykimber

7 years ago

Very good project. There's good documentation on operating the serial port on the Arduino end, but not a lot of good and current help for getting a serial port up and running on the PC with Visual Studio C++, especially since with VS 2017 you can't create a windows form project directly (you have to go through a lot of detailed steps to indirectly create a form). Fortunately, you provided a VS C++ project that had the form details already loaded, and the project almost ran perfectly first time. Two problems: 1) the COM port on the PC could be almost anything (mine was COM16), and 2) the COM port on the PC wouldn't open when the form opened. I worked around that by creating a second button on the form, and moving the serial port open and timer start commands to the click event for this second button. So to open the port I just click this "open" button. Works fine. Thanks for a great project and great code. I'm off to a great start with PC-Arduino serial communications. Ray Kimber

Image
Image

whitebank

2 years ago

Glad to hear your comment. I just make project to run, it's not so fine. Modify it if you see any problem for easy using. Don't forget to visit my blog for more project: http://engineer2you.blogspot.com/

Image
Image

Anonymous user

8 years ago

Hi, I've just read your tutorial. I think I even found it somewhere else on the web. Are you willing to make a step by step tutorial like this for a universal app?