mirror of
https://github.com/k3ng/k3ng_rotator_controller.git
synced 2025-01-31 08:25:21 +00:00
2.0.2015020801
Correction from Johan PA3FPQ on OPTION_HH12_10_BIT_READINGS
This commit is contained in:
parent
cdad7efcc9
commit
41bc6ec491
8
hh12.cpp
Executable file → Normal file
8
hh12.cpp
Executable file → Normal file
@ -63,7 +63,11 @@ float hh12::heading(){
|
|||||||
delayMicroseconds(HH12_DELAY); // delay for chip initialization
|
delayMicroseconds(HH12_DELAY); // delay for chip initialization
|
||||||
digitalWrite(hh12_clock_pin, LOW); // CLK goes low: start clocking
|
digitalWrite(hh12_clock_pin, LOW); // CLK goes low: start clocking
|
||||||
delayMicroseconds(HH12_DELAY); // hold low
|
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
|
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
|
digitalWrite(hh12_clock_pin, HIGH); //clock goes high
|
||||||
delayMicroseconds(HH12_DELAY); //
|
delayMicroseconds(HH12_DELAY); //
|
||||||
@ -106,7 +110,11 @@ float hh12::heading(){
|
|||||||
Serial.println(angle, DEC);
|
Serial.println(angle, DEC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OPTION_HH12_10_BIT_READINGS
|
||||||
floatangle = angle * 0.3515; // angle * (360/1024) == actual degrees
|
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
|
#ifdef DEBUG_HH12
|
||||||
statusbits = packeddata & statusmask;
|
statusbits = packeddata & statusmask;
|
||||||
|
1
hh12.h
Executable file → Normal file
1
hh12.h
Executable file → Normal file
@ -4,6 +4,7 @@
|
|||||||
#define HH12_DELAY 100 // microseconds
|
#define HH12_DELAY 100 // microseconds
|
||||||
//#define OPTION_HH12_10_BIT_READINGS
|
//#define OPTION_HH12_10_BIT_READINGS
|
||||||
|
|
||||||
|
|
||||||
class hh12 {
|
class hh12 {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -315,9 +315,11 @@
|
|||||||
|
|
||||||
OPTION_HH12_10_BIT_READINGS in hh12.h (thanks Johan PA3FPQ)
|
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 <avr/pgmspace.h>
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user