Pages: [1]   Go Down
Author Topic: help with usb host shield  (Read 569 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello im working on a project and i need to utilize the host shield. but the problem is i can't and not only dat i am trying to add the codes for the host shield found from this project for witch you can find the codes form https://github.com/moyuchin/WiiRemote_on_Arduino the codes i need are usb.cpp and usb.h, wiiremote.cpp and wiiremote.h so can someone please help me on how to upload those into the host shield.
thank you for your help
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the codes i need are usb.cpp and usb.h, wiiremote.cpp and wiiremote.h so can someone please help me on how to upload those into the host shield.
The host shield manages the hardware side of things. The Arduino is where code is loaded. The header files and source code files go in a folder in the libraries directory, and the header files are referenced in the sketch.

Have you put the files in the right place?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey thank you for repling but for some reason does code do not a compiling is it wrong to just copy and past those code into the arduino DUIMILANOVE ATMEGA328 or is their something that i need to do to add those codes to the arduino. also what do you mean by the hardware side of things?
thank you for your help
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but for some reason does code do not a compiling
And that reason is?

Quote
is it wrong to just copy and past those code into the arduino DUIMILANOVE ATMEGA328
Well, if you think you can, go right ahead. My Arduino does not have a drop target on it, though, so I can't paste code directly onto it.

Quote
is their something that i need to do to add those codes to the arduino.
Yes. Write a sketch that uses the libraries (that you have installed in the proper place), compile and link that sketch, and upload the resulting hex file.

Quote
what do you mean by the hardware side of things?
There are things that a USB Host does from a hardware point of view, and things that a USB Host does from a software point of view. The USB Host shield has all the hardware that makes the Arduino a USB Host device, from the hardware point of view. You need to write the software that makes it a USB Host device, from a software point of view.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Yes. Write a sketch that uses the libraries (that you have installed in the proper place), compile and link that sketch, and upload the resulting hex file.

based on that im kinda new with shields so how exactly would i first add those libraries, when you look at the codes that im talking about from https://github.com/moyuchin/WiiRemote_on_Arduino the usb.h, usb. cpp and the wiiremote.h and wiiremote.cpp how would i make those a library and also im kinda confused on the different types of files witch are the header and source code files i don't know witch one does what.
THank You very Much any help will be greatly appreciated

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
how would i make those a library
On that page, there is a button - Downloads. When you click that button, you get a choice of which compression format to download. Choose whichever one is relevant for your system.

Then, extract the files into the libraries folder in the sketch book.

A library is simply a source file, a header file, a keywords.txt file, and, hopefully, an example folder with example sketches.

There is even an example folder in that zip file that contains a sample sketch. It couldn't be much simpler to get started.

Quote
im kinda confused on the different types of files witch are the header and source code files i don't know witch one does what.
Source files contain function implementations. Header files contain function declarations. Source files have extensions like .c, .cpp, .f, .cs, etc. Header files have extensions like .h, .hxx, etc.
Logged

Pages: [1]   Go Up
Jump to: