Start with setting up the OpenNI, OpenNite and sensorkinect. Follow the steps in here: http://tohmjudson.com/?p=30
And this is the simplified version of skeleton tracking. It is using simple ellipses to draw the skeleton.
Start with setting up the OpenNI, OpenNite and sensorkinect. Follow the steps in here: http://tohmjudson.com/?p=30
And this is the simplified version of skeleton tracking. It is using simple ellipses to draw the skeleton.
I have prepared (thanks to Tom Igoe and Adam Harvey) a tutorial for Linksprite JPEG camera that you can buy from sparkfun.com.
It is really easy to use and actually it could be interesting to play with the image on the Arduino(I haven’t tried it yet).
Here is an updated version of OLED 128 library and a simple sample code.
Jenny already has a good tutorial on connecting screen and Arduino. Check out her blog for information.
My version of the code is working with Arduino 21 and I have tried it only with Arduino Uno.
Here is the result
You can find the sample code in here: http://code.google.com/p/oled128/
To make the hardware connection, you need to connect one ground and 5V pins on each Arduino. Also, for data transfer, you need to connect SDA and SCL pins.
I2C is a synchronized communication way between Arduino’s, So, you don’t need to worry about synchronization. We are using 2 pins for I2C. One of them is SDA which is the data line, and the other one is SCL which is the clock line that keeps multiple Arduino’s synchronized according to master.
On most Arduino boards, SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5. On the Arduino Mega, SDA is digital pin 20 and SCL is 21. (got it from http://arduino.cc/en/Reference/Wire)
Begin:
Initiate the Wire library and join the I2C bus as a master or slave.
Address is the name of the Arduino module, in your conversation between Arduino’s. It is really important to define addresses for each Arduino, because it is the simplest way to identify them. If address is not specified, it can be used as master. For slaves, address should be determined.
Address: the 7-bit slave address (0-127).
None
Example
void setup(){
Wire.begin(4); // join i2c bus with address #4
}
This function is for, when master requests bytes from a slave. You need to define the address of the slave that you are asking bytes, also number of bytes that you are asking from that slave.
The bytes may then be retrieved with the available() and receive() functions.
address: the 7-bit address of the device to request bytes from
quantity: the number of bytes to request
None
Example
for master
// by Nicholas Zambetti <http://www.zambetti.com>
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // serial connection
}
void loop()
{
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
while(Wire.available()) // slave may send less than requested
{
char c = Wire.receive(); // receive a byte as character, you can chance “char” according to what you are sending from your slave (ex: byte, float etc.)
Serial.print(c); // print the character
}
delay(500);
}
Begin transmitting data to the I2C slave device with the given address. This function calls master device that, you are about to start transmitting data to defined slave. Subsequently, queue bytes for transmission with the send() function and transmit them by calling endTransmission().
address: the 7-bit address of the device to transmit to
None
Example
for master
// by Nicholas Zambetti <http://www.zambetti.com>
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
byte x = 0; //data to transmit
void loop()
{
Wire.beginTransmission(4); // transmit to device #4
Wire.send(“x is “); // sends five bytes
Wire.send(x); // sends one byte
Wire.endTransmission(); // stop transmitting, this function makes the transmission
x++;
delay(500);
}
Ends a transmission to a slave device that was begun by beginTransmission() and actually transmits the bytes that were queued by send().
None
None
Sends data from a slave device in response to a request from a master, or queues bytes for transmission from a master to slave device (in-between calls to beginTransmission() and endTransmission()).
value: a byte to send (byte)
string: a string to send (char *)
data: an array of data to send (byte *)
quantity: the number of bytes of data to transmit (byte)
None
Returns the number of bytes available for retrieval with receive(). This should be called on a master device after a call to requestFrom() or on a slave inside the onReceive() handler.
None
The number of bytes available for reading.
Example
for master
// by Nicholas Zambetti <http://www.zambetti.com>
void loop()
{
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
while(Wire.available()) // slave may send less than requested
{
char c = Wire.receive(); // receive a byte as character
Serial.print(c); // print the character
}
delay(500);
}
Retrieve a byte that was transmitted from a slave device to a master after a call to requestFrom or was transmitted from a master to a slave.
None
The next byte received.
Example
for slave
// by Nicholas Zambetti <http://www.zambetti.com>
void loop()
{
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
while(Wire.available()) // slave may send less than requested
{
char c = Wire.receive(); // receive a byte as character
Serial.print(c); // print the character
}
delay(500);
}
Registers a function to be called when a slave device receives a transmission from a master.
Wire.onRecive(handler) should be in setup function. Whenever slave receives a data from master, Wire,onReceive(handler) calls the handler function to handle the receiving process from master.
handler: the function to be called when the slave receives data; this should take a single int parameter (the number of bytes received from the master) and return nothing, e.g.: void myHandler(int numBytes)
for slave
// by Nicholas Zambetti <http://www.zambetti.com>
#include <Wire.h>
void setup()
{
Wire.begin(4); // join i2c bus with address #4
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}
void loop()
{
delay(100);
}
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany)
{
while(1 < Wire.available()) // loop through all but the last
{
char c = Wire.receive(); // receive byte as a character
Serial.print(c); // print the character
}
}
None
Register a function to be called when a master requests data from this slave device.
Wire.onRequest(handler) should be in setup function. Whenever master requests a data from slave, Wire,onRequest(handler) calls the handler function to handle the request process from master.
handler: the function to be called, takes no parameters and returns nothing, e.g.: void myHandler()
None
Example
For slave
// by Nicholas Zambetti <http://www.zambetti.com>
#include <Wire.h>
void setup()
{
Wire.begin(2); // join i2c bus with address #2
Wire.onRequest(requestEvent); // register event
}
void loop()
{
delay(100);
}
// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent()
{
Wire.send(“hello “); // respond with message of 6 bytes
// as expected by master
}
TSL230R is a programmable light frequency integrated circuit(IC) that gives you pulses which are related to light intensity.
You can find a tutorial for using it in here: http://itp.nyu.edu/physcomp/sensors/Reports/TSL230R