Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x,y;
- void setup() {
- // put your setup code here, to run once:
- pinMode(2, INPUT);
- pinMode(2, INPUT);
- Serial.begin(9600);
- //attachInterrupt(digitalPinToInterrupt(2), blink, CHANGE);
- //attachInterrupt(digitalPinToInterrupt(3), blink, CHANGE);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- int ax = x;
- int ay = y;
- x = digitalRead(2);
- y = digitalRead(3);
- if(x != ax){
- Serial.print(x);
- Serial.println(y);
- }
- if(y != ay){
- Serial.print(x);
- Serial.println(y);
- }
- }
Add Comment
Please, Sign In to add comment