This program is going to used by doctors to decide if a patient has a HPV virus and what type of the virus analyzing a photo. Until you make that choice, and we can't make it for you, then we can't really help you. 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? You keep going on about this mysterious program your teacher has, but never tell us what it actually is, nor what it does. Printf(“error: failed to send message \n”) Reply=usb_bulk_write(dev,ep_out,msg,sizeof(msg),5000) Printf(“error: claiming interface 0 failed\n”) Printf(“error: setting config 1 failed\n”) Usb_find_devices() / find all connected devices */ Usb_dev_handle dev = NULL / the device handle /Ĭhar msg / every function will have it’s msg/ Printf(“Didn’t Find Specified Device\n”) Incoming = ‘\0’ // Add null terminator…įor(bus = usb_get_busses() bus bus = bus->next)įor(dev = bus->devices dev dev = dev->next) Can you help me find any mistakes in both codes?īytesRead = Serial.readBytesUntil(’\n’, incoming, 7) #Libusb Serial Port code#When i run my code from pc i can see Rx led flashing one time but i cannot see any response from leds. With Serial Monitor from tools it seems that it’s code is correct. So i connect Arduino with usb cable and i upload my code into it. Ok, here is my code… C code and arduino code. What you can do is use the USB for your libusb communicationĪnd then use the real UART inside the 32u4 for your serial port. In the absence of source level debugging, It can be done with the Arduino IDE (I've done it) but it is not easy to set up and I'm not sure If you had an AVR dragon, or a AVR ICE you could use Atmel Studio instead of the Arduino IDE On Leonardo, that "serial" interface uses a virtual serial interface over USB.īut in this case, you can't use that because you will be using the USB for raw USB communication The default serial interface is named "Serial". The only way that is typically used is sending character data (printed messages)įrom the Arduino board over a serial or virtual serial interface back to the host. The challenge when using the Arduino environment is going to be that it has no debugging environment If you google you can find lots of information out there on libusb To get a feel for libusb and the API functions, have a look at the documentation here: It is Host USB (PC) talking to Device USB (the leonardo) directly over USB. You open a connection to a device bulk end point and push data at it. You don't open a USB port to get a PC to talk to an Arduino.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |