Back to photostream

Hacked DjHero

// Wire Master Reader

// by Nicholas Zambetti

 

// Demonstrates use of the Wire library

// Reads data from an I2C/TWI slave device

// Refer to the "Wire Slave Sender" example for use with this

 

// Created 29 March 2006

 

// This example code is in the public domain.

 

 

#include

 

void setup()

{

Serial.begin(9600); // start serial for output

Wire.begin(0x0D);

}

 

byte a[10];

 

void loop()

{

Wire.beginTransmission(0x0D);

Wire.send(0);

Wire.endTransmission();

Wire.requestFrom(0x0D, 23);

for (int i=0; i 0 clockwise <255 anticlockwise

Serial.print(' ');

Serial.println(a[21],DEC); //rotation dir 0=clockwise 255=anticlockwise

}

157 views
1 fave
2 comments
Uploaded on April 25, 2012
Taken on April 25, 2012