2.0.2015020801

Correction from Johan PA3FPQ on OPTION_HH12_10_BIT_READINGS
This commit is contained in:
Anthony Good 2015-02-08 19:24:13 -05:00
parent cdad7efcc9
commit 41bc6ec491
3 changed files with 153 additions and 142 deletions

8
hh12.cpp Executable file → Normal file
View File

@ -63,7 +63,11 @@ float hh12::heading(){
delayMicroseconds(HH12_DELAY); // delay for chip initialization
digitalWrite(hh12_clock_pin, LOW); // CLK goes low: start clocking
delayMicroseconds(HH12_DELAY); // hold low
#ifdef OPTION_HH12_10_BIT_READINGS
for (int x=0; x <16; x++) // clock signal, 16 transitions, output to clock pin
#else
for (int x=0; x <18; x++) // clock signal, 18 transitions, output to clock pin
#endif //OPTION_HH12_10_BIT_READINGS
{
digitalWrite(hh12_clock_pin, HIGH); //clock goes high
delayMicroseconds(HH12_DELAY); //
@ -106,7 +110,11 @@ float hh12::heading(){
Serial.println(angle, DEC);
#endif
#ifdef OPTION_HH12_10_BIT_READINGS
floatangle = angle * 0.3515; // angle * (360/1024) == actual degrees
#else
floatangle = angle * 0.08789; // angle * (360/4096) == actual degrees
#endif //OPTION_HH12_10_BIT_READINGS
#ifdef DEBUG_HH12
statusbits = packeddata & statusmask;

1
hh12.h Executable file → Normal file
View File

@ -4,6 +4,7 @@
#define HH12_DELAY 100 // microseconds
//#define OPTION_HH12_10_BIT_READINGS
class hh12 {
public:

View File

@ -315,9 +315,11 @@
OPTION_HH12_10_BIT_READINGS in hh12.h (thanks Johan PA3FPQ)
Correction from Johan PA3FPQ on OPTION_HH12_10_BIT_READINGS
*/
#define CODE_VERSION "2.0.2015020702"
#define CODE_VERSION "2.0.2015020801"
#include <avr/pgmspace.h>
#include <EEPROM.h>