USB Host Shield and Ethernet Project

Hello I need help on a project that includes arduino uno/ethernet shield/usb host shield. It will take data from a tinkerkit joy stick and other things like motion sensor, photo cell, temp. sensor etc. then display it on my website http://www.nimbitmusic.com/arduinomax. So I need help first on geting readings from my joystick, any examples?

Yes, there are a bunch of helpful examples already given to you under File -> Examples.
Start from the top and work your way down. :grinning:

Thanks HazardsMind. But I could not find one on usb host shield or tinkerkit joystick. Do you know any other place that could help?

Its just like any other joystick really, but with a quick search, I found this.
http://www.mouser.com/catalog/specsheets/TinkerKitJoyStick.pdf

You will probably find more examples for the USB shield in the Arduino playground.

Ok so I tried it but the values stayed about 300

It is generally held that topics in all caps and containing words such as "HELP" or "EXTREME" or more that one exclamation point are not worth answering.

A gentle hint - you can change the heading on your first post.

MaxSC:
Ok so I tried it but the values stayed about 300

What did you try?
If you really want some advice, you need to give us the information so that we can help you.
This usually includes posting your code in code tags so it looks like this and a diagram showing clearly how you have everything connected.

I can't think of anything in your project that justifies the use of the word "extreme" in your title.

...R

Did you connect the joystick to the same inputs as the ones used in your sketch?

You will not have any success unless the software and hardware match. If it is wrong, you can change either, whichever is easiest.

You misspelled EXTREME, by the way.

Did you read the datasheet linked in Reply#3 ?

Did you try that code ?

Do you have a meter ?
Can you explain why you are getting a value of 300 for 5V ? (is it really 5V ?)

Maybe you should post your code and a schematic.

Thanks Paul__B it was defintly a little overboard

Thanks Paul__B it was defintly a little overboard

(so why haven't you changed it ?)

Sorry I took a little time changing it

This is what I have done. sorry I did not give that much info.

This one used serial moniter and the value stayed about 300

/*
Analog input, analog output, serial output
Reads two analog input pins; a T000030 Jopystick Module Analog Sensor
connected to I0 and I1, maps the result to a range from 0 to 255
and uses the result to set the pulsewidth modulation (PWM) two T010111 LED
Module connected on O0 and O1.
Also prints the results to the serial monitor.
created 7 dec 2010
by Davide Gomba
This example code is in the public domain.
*/
#define O0 11
#define O1 10
#define O2 9
#define O3 6
#define O4 5
#define O5 3
#define I0 A0
#define I1 A1
#define I2 A2
#define I3 A3
#define I4 A4
#define I5 A5
// These constants won't change. They're used to give names
// to the pins used:
const int analogInPin1 = I0; // Analog input pin that the Joystick's first
pin is attached to
const int analogInPin2 = I1; // Analog input pin that the Joystick's
second pin is attached to
const int analogOutPin1= O0; // Analog output pin that the LED is attached
to
const int analogOutPin2= O1; // Analog output pin that the LED is attached
to
int sensorValue1 = 0; // value read from the Joystick's first pin
int sensorValue2 = 0; // value read from the Joystick's second pin
int outputValue1 = 0; // value output to the PWM (analog out)
int outputValue2 = 0; // value output to the PWM (analog out)
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the both analog in values:
sensorValue1 = analogRead(analogInPin1);
sensorValue2 = analogRead(analogInPin2);
// map it to the range of the analog out:
outputValue1 = map(sensorValue1, 0, 1023, 0, 255);
outputValue2 = map(sensorValue2, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin1, outputValue1);
analogWrite(analogOutPin2, outputValue2);
// print the results to the serial monitor:
Serial.print("Joystick X = " );
Serial.print(sensorValue1);
Serial.print("\t Joystick Y = " );
Serial.print(sensorValue2);
Serial.print("\t output 1 = ");
Serial.print(outputValue1);
Serial.print("\t output 2 = ");
Serial.println(outputValue2);
// wait 10 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(10);
}

This one had a error on line (Joystick me=Joystick(A1,A0):wink:

/* Joystick
*       The joystick is one component but uses two analog sensors and 
*       gives you two values. One x value and one y value. The value 
*       for each direction is zero if it’s in the middle, -1 on one side 
*       and 1 on the other side. 
*
* The joystick returns the position it is being pushed to.
*       It returns two values, one X value and one Y value. That is the
*       position on the X axis (left to right) and the position on the
*       Y axis (top to bottom).Each value can be -1, 0 or 1 where 0 is
*       the middle position. E.g. x=-1 and y=1 means that the joysticks
*       position is left top, x=0 and y=-1 means that the position is
*       middle bottom.
*
*       (c) 2013 Arduino Verkstad
*/

#include <BasicEducationShield.h>

//The joystick uses two analog pins. One for X and one for Y.
Joystick me=Joystick(A1,A0);

void setup(){
 //Start serial comunication to be able to print values to the serial monitor
 Serial.begin(9600);
}
void loop(){
 Serial.print("X: ");
 Serial.print(me.getX()); //Get the X value and print it.
 Serial.print("  Y: ");
 Serial.println(me.getY()); //Get the Y value and print it.
 delay(200);
}

I have no idea why it put the dude faces dude=00

MaxSC:
I have no idea why it put the dude faces dude=00

#7 below.

http://forum.arduino.cc/index.php/topic,148850.0.html

Is this project possible

Love the little O0 I've never seen that before. Thank you :slight_smile:

Hello KenF. Do you know anything about the usb host shield or tinkerkit joystick?

KenF:
Love the little O0 I've never seen that before. Thank you :slight_smile:

Weren't those guys taken off the Robertson's jam jars because they were non-PC?

...R

MaxSC:
Hello I need help on a project that includes arduino uno/ethernet shield/usb host shield. It will take data from a tinkerkit joy stick and other things like motion sensor, photo cell, temp. sensor etc. then display it on my website http://www.nimbitmusic.com/arduinomax. So I need help first on geting readings from my joystick, any examples?

I also need help with getting a ethernet shield to send data to the internet.