/* IDG300 Gyro Reads IDG300 Gyro and communicates the data to the computer. The pins used are designed to be easily compatible with the breakout boards from Sparkfun, available from: http://www.sparkfun.com/ The circuit: analog 3: xout analog 2: vref output analog 1: yout analog 0: GND */ // these constants describe the pins. They won't change: const int groundPin = 14; // analog input pin 0 -- ground const int xout = 3; // xout const int vref = 2; // reference voltage has no meaning here const int yout = 1; // yout void setup() { // initialize the serial communications: Serial.begin(9600); // Provide ground by using the analog inputs as normal // digital pins. This makes it possible to directly connect the // breakout board to the Arduino. Just to be safe I connected 3.3v // to the appropriate power supply on the arduino and not to a digital pin. pinMode(groundPin, OUTPUT); digitalWrite(groundPin, LOW); } void loop() { // print the sensor values: Serial.print(analogRead(xout)); // print a tab between values: Serial.print("\t"); Serial.print(analogRead(yout)); // print a tab between values: Serial.print("\t"); Serial.print(analogRead(vref)); Serial.println(); // delay before next reading: delay(100); }