diff --git a/hh12.cpp b/hh12.cpp index 18cce59..ee38387 100755 --- a/hh12.cpp +++ b/hh12.cpp @@ -9,6 +9,8 @@ Code adapted from here: http://www.madscientisthut.com/forum_php/viewtopic.php?f=11&t=7 +Updated 2015-02-07 for 12 bit readings - Thanks Johan PA3FPQ + */ @@ -21,7 +23,11 @@ int inputstream = 0; //one bit read from pin long packeddata = 0; //two bytes concatenated from inputstream long angle = 0; //holds processed angle value float floatangle = 0; +#ifdef OPTION_HH12_10_BIT_READINGS long anglemask = 65472; //0x1111111111000000: mask to obtain first 10 digits with position info +#else +long anglemask = 262080; // 0x111111111111000000: mask to obtain first 12 digits with position info +#endif //OPTION_HH12_10_BIT_READINGS long statusmask = 63; //0x000000000111111; mask to obtain last 6 digits containing status info long statusbits; //holds status/error information int DECn; //bit holding decreasing magnet field error data diff --git a/hh12.h b/hh12.h index 2edafa0..b74001d 100755 --- a/hh12.h +++ b/hh12.h @@ -2,6 +2,7 @@ #define hh12_h #define HH12_DELAY 100 // microseconds +//#define OPTION_HH12_10_BIT_READINGS class hh12 { diff --git a/k3ng_rotator_controller.ino b/k3ng_rotator_controller.ino index d1afe68..e2e12a5 100644 --- a/k3ng_rotator_controller.ino +++ b/k3ng_rotator_controller.ino @@ -313,9 +313,11 @@ OPTION_EL_PULSE_DEBOUNCE code - (thanks Gianfranco, IZ8EWD) #define EL_POSITION_PULSE_DEBOUNCE 500 // in ms + OPTION_HH12_10_BIT_READINGS in hh12.h (thanks Johan PA3FPQ) + */ -#define CODE_VERSION "2.0.2015011802" +#define CODE_VERSION "2.0.2015020702" #include #include diff --git a/rotator_features.h b/rotator_features.h index 11fd68f..f9e5291 100644 --- a/rotator_features.h +++ b/rotator_features.h @@ -131,6 +131,7 @@ + /* Note: