Quote from: mdimiou on Jul 20, 2014, 11:27 amI want to make function.... and i want to send some data from a usb port.Do you mean that you want to write a function for a program that runs on a PC so that the PC can communicate with a Leonardo over a USB connection?If not, what computer will be running the function that uses Libusb?You are not providing us with sufficient information for anyone to be able to give you good advice.Your question is a bit like "I have to use a Honda engine, how do I get to San Francisco?"...R
I want to make function.... and i want to send some data from a usb port.
There is already made a code by my teacher which is running on a PC.I have to make some functions for this program and in there i have to send some data to Arduino through USB.I am using windows 7 and i have dev c++ and Visual studio 2010 express.
These functions won't have any input parameters.
You don't open a USB port to get a PC to talk to an Arduino.
To get a feel for libusb and the API functions, have a look at the documentation here:
You keep going on about this mysterious program your teacher has, but never tell us what it actually is, nor what it does.You have to make a choice. Are you going to try and use a HID interface and libusb, which will be a nightmare to do as you are basically working from the lowest levels of the system, or are you going to scrap the whole idea of libusb and just open a serial port to send data?Until you make that choice, and we can't make it for you, then we can't really help you.