Documentation added for the USB Host Library
I’m happy to announce that documentation is now available for all the libraries I have written for the USB Host Shield library.
The documentation is available at the following link: http://felis.github.com/USB_Host_Shield_2.0.
The documentation is generated using Doxygen which is a free documentation-generator based upon the header files in the source code.
For instance the following comment will end up looking like this in the documentation:
I hope this will be useful for people who is new to the USB host library or even people who just want a quick overview.
If you spot any typos or got any comments please let me know in the comments below.
Categories: Arduino, Bluetooth, TKJ Electronics, USB
Awesome Lauszus,
Thank you very much
Thank you for this.
It would be great if the same could be made for the PTP lib.
I’m struggling with being able to compile the examples for this library and cannot find an accurate guide and help…
@Adi Soffer
I haven’t wrote that library, so I’m afraid that I’m not able to do that.
What version of the QP library are you using? Actually I have never used that library.
@Lauszus
Hey – thanks for taking the time here –
after reading extensively about it I’m using 4.3
@Adi Soffer
Here is a zip file with the code: PTP_20.zip. I have made the necessary changes, in order for the library to compile.
Also make sure that the USB Host library directory is called: “USB_Host_Shield_20”
I really appreciate this.
Since I’ve gone through all sorts of library editing after reading comments and tips,
I’ll let you know the changes I’ve made:
1. Replaced qp_ccp (as was recommended by Oleg)
2. Commented out these lines in the qp_port.cpp: (as was recommended by Alex)
// void operator delete(void *) {
// Q_ERROR(); // this operator should never be actually called
// }
3. Added the following line to eoseventhandler.h file found in EOSCamController folder:
virtual void OnObjectCreated(const EOSEvent *evt) {};
(as was recommended by Alex)
All this led to being able to compile all – but the EOSRemote sketch – that compiled with the following error:
EOSRemote.cpp: In member function â??virtual void CamStateHandlers::OnDeviceInitializedState(PTP*)â??:
EOSRemote.pde:-1: error: cannot declare variable â??hndâ?? to be of abstract type â??EosEventHandlersâ??
/eoseventhandlers.h:12: note: because the following virtual functions are pure within â??EosEventHandlersâ??:
C:Program Files (x86)arduino-1.0.1librariesptp/eoseventparser.h:37: note: virtual void EOSEventHandlers::OnObjectCreated(const EOSEvent*)
Now, after dl your zip and renaming as instructed, EOSCamController is no longer able to compile. I’m pasting jsut the first few lines of the error log so as not to clog everything up here:
qpqp.cpp.o: In function `QEP::getVersion()’:
C:Program Files (x86)arduino-1.0.3librariesqp/qp.cpp:95: multiple definition of `QEP::getVersion()’
PTP_20qp.cpp.o:C:Program Files (x86)arduino-1.0.3librariesPTP_20/qp.cpp:95: first defined here
Once again, thanks a lot
@soffer
Simply delete both the PTP and QP libraries downloaded and download the zip file I provided! I have made the necessary changes to make it work.
Oh man – It is finally compiling!
Thank you so much!
This is great, and I’m truly thankful.
I can finally begin testing this with my 5D mkII
🙂
@soffer
You are welcome 🙂
Mil gracias por informacion tan valiosa. Será de gran ayuda para realizar proyectos con arduino.
@Jose Wilson
You are welcome 🙂
downloading the current USB_Host_Shield_20 then your PTP_20 above, can not compile any of the files due to PrintHex:
(example from EOSRemote)
C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp: In member function ‘virtual void EOSEventDump::Parse(uint16_t, const uint8_t*, const uint32_t&)’:
C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:38: error: no matching function for call to ‘PrintHex(unsigned char&)’
C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:67: error: no matching function for call to ‘PrintHex(unsigned char&)’
C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:81: error: no matching function for call to ‘PrintHex(unsigned char&)’
C:UsersmoofletaDocumentsArduinolibrariesPTP_20eoseventdump.cpp:99: error: no matching function for call to ‘PrintHex(unsigned char&)’
@Lauszus – any chance that the PrintHex is either not being loaded or changed? I could not find (maybe I missed) where its including printhex.h also I saw that many of the other examples were modified to use: D_PrintHex recently.
Could you please assist?
@Moofleta
That’s because the libraries has been changes since.
I believe Oleg has already made the changes to the PTP library: https://github.com/felis/PTP_2.0/commits/master.
Please see the following comment I wrote: http://www.circuitsathome.com/camera-control/ptp-2-0-library-function-turns-on-bulb-mode-on-nikon-dslr-camera-via-usb/comment-page-1#comment-18312.
It shows all the steps you need to do in order for it to compile 🙂
Thank you for the tips, any idea if Canon 5D Mark 3 is supported?
@Moofleta
Yes it is supported 😉
Lauszus
I’m not able to compile your ptp_20 library.
Using IDE 1.05 here on osx.
Can you recap the correct procedure and files to be downloaded?
Thak you
@Harpix
You can follow the instructions here: http://www.circuitsathome.com/camera-control/ptp-2-0-library-function-turns-on-bulb-mode-on-nikon-dslr-camera-via-usb/comment-page-1#comment-18312 or simply download the zip I have provided: http://blog.tkjelectronics.dk/wp-content/uploads/PTP_20.zip.
Btw I did not write the library – Oleg did 😉
Thank you Lauszus.
I’ve tried several times with your file but no way…I will try again with your instructions but the main issue are the qp libraries ver 4.3.0 for arduino, not available for download.
I will try to ask also for Oleg’s help.
Best Regards
@Harpix
You should properly ask for the old version at the product page: http://www.state-machine.com/arduino/.
I can see that you invest a lot of time and work into this whole thing. Alas, it’s not a documentation. I’m not able to find out what the examples are supposed to do. I don’t see a general overview of how it all works. I don’t see any explanation for the functions. Yes, it’s down to my stupidity, but there is no place where I can find the basics about it.
This is all very frustrating when things seem not to run through as they should and you have no handle at all to find out what actually may go wrong.
@Prieni
I do realise that the examples are not that well documented, but if you upload the code and plug in your controller/dongle then I am sure that you would be able to figure out what is going on based on the output shown in the serial monitor 🙂
It will also be a good idea to enable serial debugging: https://github.com/felis/USB_Host_Shield_2.0#enable-debugging.
Hi,
I’m trying to use the USB Host shield stack with a thrustmaster joystick and I think it is not detected correclty.
When I activate the debugging I’ve
Start
HU Init
Addr:01
NC:01
Cnf:01
HU configured
When the data written in the serial plotter are false.
All the data are uint_8 but the joystick have 16 bits value.
How can I modify to make a correct parser ?
Thanks for this huge works.