Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- int LED = 13;
- int x = 0;
- void setup() {
- // put your setup code here, to run once:
- pinMode (LED, OUTPUT);
- Wire.begin(4);
- Wire.onReceive(receiveEvent);
- }
- void receiveEvent(int bytes){
- x = Wire.read();
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if (x == 0) {
- digitalWrite(LED, HIGH);
- delay(540);
- digitalWrite(LED, LOW);
- delay(540);
- }
- if (x == 3){
- digitalWrite(LED, HIGH);
- delay(200);
- digitalWrite(LED, LOW);
- delay(200);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement