summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Drehimpulsgeber/drehimp.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/Drehimpulsgeber/drehimp.cpp b/Drehimpulsgeber/drehimp.cpp
index 21011e7..4f64629 100644
--- a/Drehimpulsgeber/drehimp.cpp
+++ b/Drehimpulsgeber/drehimp.cpp
@@ -1,8 +1,16 @@
+#include <Arduino.h>
+
+void doCount0();
+void doCount1();
+
volatile int cnt0 = 0; // Digitaler Pin 2 und 3
volatile int cnt1 = 0;
void setup()
-{ attachInterrupt(0, doCount0, CHANGE);
+{
+ digitalWrite(2, HIGH);
+ digitalWrite(3, HIGH);
+ attachInterrupt(0, doCount0, CHANGE);
attachInterrupt(1, doCount1, CHANGE);
Serial.begin(9600);
}
@@ -15,5 +23,6 @@ void loop()
}
// Dummy interrupt functions
-void doCount0() { cnt0++;  }
-void doCount1() { cnt1++;  }
+void doCount0() {cnt0++;}
+void doCount1() {cnt1++;}
+