Add uOLED-96-G1 C Sample Code.
[frickel.git] / projects / geeknamensschilder_c / hardware / libraries / Wire / examples / slave_sender / slave_sender.pde
blobf500644c055a56fb481bfcecfd6bc01a5a885285
1 // Wire Slave Sender
2 // by Nicholas Zambetti <http://www.zambetti.com>
4 // Demonstrates use of the Wire library
5 // Sends data as an I2C/TWI slave device
6 // Refer to the "Wire Master Reader" example for use with this
8 // Created 29 March 2006
10 #include <Wire.h>
12 void setup()
14   Wire.begin(2);                // join i2c bus with address #2
15   Wire.onRequest(requestEvent); // register event
18 void loop()
20   delay(100);
23 // function that executes whenever data is requested by master
24 // this function is registered as an event, see setup()
25 void requestEvent()
27   Wire.send("hello "); // respond with message of 6 bytes
28                        // as expected by master