diff options
author | Alexander Kauerz <kauerz@informatik.uni-luebeck.de> | 2012-02-15 21:56:04 +0100 |
---|---|---|
committer | Alexander Kauerz <kauerz@informatik.uni-luebeck.de> | 2012-02-15 21:56:04 +0100 |
commit | ecf956c537a801d6b0ccfaf4e14c840c2daf25c3 (patch) | |
tree | 417852455f88aa83c7342963e2cba36216acd412 | |
parent | c58f6cd195638701f6cf5a80883c32c936f4c903 (diff) | |
download | ledmatrix-ecf956c537a801d6b0ccfaf4e14c840c2daf25c3.tar ledmatrix-ecf956c537a801d6b0ccfaf4e14c840c2daf25c3.zip |
erste funktionierende version - bewegung wird erkannt.
-rw-r--r-- | Drehimpulsgeber/drehimp.cpp | 15 |
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++;} + |