Go Down

Topic: Libusb help (Read 14335 times) previous topic - next topic

mdimiou

Hello, i want ask a programming question but not for the arduino itself.

I have an arduino Leonardo and i have to make a fuction which they will send data to Arduino Leonardo from a USB port.
I have to use libusb, but i have never used libusb and i don't know it. So i would like first of all to ask if there is anybody who can help me with this.



Sr for my bad English

rogerClark

Quote
I have to use libusb


Which libusb are you referring to ?

Quote
I have an arduino Leonardo and i have to make a fuction which they will send data to Arduino Leonardo from a USB port


You seem to imply that one Leonardo needs to operate as a USB host and the other as a USB client  is this correct ?

Freelance developer and IT consultant
www.rogerclark.net

mdimiou

Quote


Which libusb are you referring to ?



I have downloaded this zip file

LIBUSB64Fix.zip

Quote


You seem to imply that one Leonardo needs to operate as a USB host and the other as a USB client  is this correct ?



Yes


bperrybap

You don't have to use libusb to communicate with Leonardo.
You can use the USB CDC class so it looks like serial port to the application on
the host.
It is much easier than using libusb to send/receive usb bulk block messages.

Here is some additional reading:
http://arduino.cc/en/Guide/ArduinoLeonardoMicro?from=Guide.ArduinoLeonardo

--- bill

mdimiou

This is for a uni project and my teacher asked me to use it so.... :/


bperrybap

Do you have to use Leonardo?
USB support is  better on Paul's Teensy boards:
https://www.pjrc.com/teensy/

I've used libusb and isn't that difficult on Linux.
Not sure which OS you are using.
(I don't use Windows)

--- bill

mdimiou

I have already bought Leonardo.... :/


I am using Windows

rogerClark

Quote
I have downloaded this zip file

LIBUSB64Fix.zip


That doesn't really tell anyone very much.

I Googled LIBUSB64Fix.zip   and got "About 2,540 results"  which doesn't narrow it down very much.


Quote
This is for a uni project and my teacher asked me to use it so.... :/


Well, good luck with that.

I presume your "teacher" expects you to do the work yourself, or are you on a business course where the outcome is to get someone else to do it for you?
Freelance developer and IT consultant
www.rogerclark.net

mdimiou


majenkotech

Have you tried reading the documentation for libusb?

If you tell us what it is you actually want to achieve we may be in a better position to help you out.  As it is, we have even less of a clue than you do.
A better IDE for the Arudino: UECIDE - The Universal Embedded Computing IDE.

mdimiou

I want to make function.... and i want to send some data from a usb port.

majenkotech

... and I am still non the wiser.

You want to make a function?  Ok, here's a function:

Code: [Select]

int myHappyFunction(int z) {
  int x = 43;
  int y = 2993;
  return (x + c) * (y/c);
}


And here's sending some data over USB:

Code: [Select]

Serial.println("Hello USB port. I am some serial data sent over you!");
[code]
Now, none of those answer your question in the slightest - just in the same way that you haven't answered our questions.
[/code]
A better IDE for the Arudino: UECIDE - The Universal Embedded Computing IDE.

Robin2


I 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
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up