that_one_nigga_you_k

doido

Mar 27th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1.   int x,y;
  2.  
  3. void setup() {
  4.   // put your setup code here, to run once:
  5.   pinMode(2, INPUT);
  6.   pinMode(2, INPUT);
  7.   Serial.begin(9600);
  8.    //attachInterrupt(digitalPinToInterrupt(2), blink, CHANGE);
  9.    //attachInterrupt(digitalPinToInterrupt(3), blink, CHANGE);
  10. }
  11.  
  12. void loop() {
  13.   // put your main code here, to run repeatedly:
  14.   int ax = x;
  15.   int ay = y;
  16.   x = digitalRead(2);
  17.   y = digitalRead(3);
  18.  
  19.   if(x != ax){
  20.   Serial.print(x);
  21.   Serial.println(y);  
  22. }
  23.   if(y != ay){
  24.   Serial.print(x);
  25.   Serial.println(y);
  26. }
  27. }
Add Comment
Please, Sign In to add comment