Advertisement
BnEc

Master

Feb 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <Wire.h>
  2.  
  3. int x = 0;
  4.  
  5. void setup() {
  6.   // put your setup code here, to run once:
  7. Wire.begin();
  8.  
  9. }
  10.  
  11. void loop() {
  12.   // put your main code here, to run repeatedly:
  13. Wire.beginTransmission(4);
  14. Wire.write(x);
  15. Wire.endTransmission();
  16. x++;
  17. if (x > 5) x = 0;
  18. delay(1000);
  19. Wire.beginTransmission(3);
  20. Wire.write(x);
  21. Wire.endTransmission();
  22. x++;
  23. if (x > 12) x = 0;
  24. delay(400);
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement