Created
May 19, 2012 23:54
-
-
Save anonymous/2732889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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