Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 365
Robert Lucian Chiriac Avatar asked Apr 28 '13 16:04

Robert Lucian Chiriac


People also ask

What is libusb used for?

libusb is a library that provides applications with access for controlling data transfer to and from USB devices on Unix and non-Unix systems, without the need for kernel-mode drivers.

How do I install libusb on Windows 10?

Click Driver label and click 'Update Driver'. Choose “Browse my computer for driver software”. Choose “Let me pick from a list of device drivers on my computer”. Click “Have Disk” and locate to your driver files directory.

Where can I download libusb?

libusb: A free library for accessing USB devices written in C. libusb is a free and open-source library for interacting with USB devices written in C. It is available for download on Github.

How do I add libusb to Visual Studio?

You will need to include the libusb header file in your source project. Then under your project settings you should go to the Linker section and add the LIB file as a linked object. Then, just ensure your DLL is accessible to your executable when running or debugging.


2 Answers

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.

like image 105
Tristan Bourvon Avatar answered Sep 19 '22 07:09

Tristan Bourvon


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.

like image 34
bmorin Avatar answered Sep 22 '22 07:09

bmorin