Skip to content

Instantly share code, notes, and snippets.

Created January 28, 2015 09:23
Show Gist options
  • Save anonymous/0b62be94302c26b4c6fb to your computer and use it in GitHub Desktop.
Save anonymous/0b62be94302c26b4c6fb to your computer and use it in GitHub Desktop.
#include "Arduino.h"
#include <SPI.h>
#include <Wire.h>
#include <EEPROM.h>
#include <avr/wdt.h>
void dataReceive(int numBytes)
{
Serial.print("Receive");
}
void dataRequest() {
Serial.println("Request");
}
void setup()
{
// Setup TWI protocol
Wire.begin(4);
Wire.onRequest(dataRequest);
Wire.onReceive(dataReceive);
}
void loop()
{
// Do stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment