Robert Lucian Chiriac
Robert Lucian Chiriac

Reputation: 716

C++ USB library

Is there a library/method for communicating with a microcontroller (Arduino)?

Basically, I need a method of receiving and sending data between the PC and the Arduino. I don't know what library to use, so I'm asking you. The data I'm going to send is little. Maybe 500 bytes back and forth. Everything is happening in Visual C++ 2010, in a console application.

Upvotes: 8

Views: 3997

Answers (4)

P_B
P_B

Reputation: 214

Yes, ArduSerail is a SUPER easy to use C++ library to interface with Arduinos on Windows platforms via USB.

Upvotes: 0

Arno Duvenhage
Arno Duvenhage

Reputation: 1960

Boost ASIO works well. Have a look at Stack Overflow question Reading messages from a serial port with Boost Asio. I recently had to write some code for communicating through the serial port, and I used an Arduino Uno to test it.

If you install the FTDI driver for your Arduino board, Windows will recognise it as a COM port, and you can communicate with it as if it is a normal serial port.

Upvotes: 0

bmorin
bmorin

Reputation: 645

termios also works fine. I've been using it to connect an Arduino to a Raspberry Pi (Linux) via serial link (USB). You could find some useful code snippets here.

Upvotes: 1

Tristan Bourvon
Tristan Bourvon

Reputation: 366

libusb seems to be one of the best choices in your case. This is a lightweight, widely-used, open-source, cross-platform and well-documented C library.

Upvotes: 5

Related Questions