Skip to content

Instantly share code, notes, and snippets.

Created May 19, 2012 23:54
Show Gist options
  • Save anonymous/2732889 to your computer and use it in GitHub Desktop.
Save anonymous/2732889 to your computer and use it in GitHub Desktop.
#include <Wire.h>
int pin;
int estado;
void setup()
{
Wire.begin(2);
Wire.onReceive(receiveEvent);
}
void loop()
{
}
void receiveEvent(int howMany)
{
pin = Wire.receive();
estado = Wire.receive();
digitalWrite(pin, estado);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment