From b97e45b54453fd7a829b84157721cfaea7bfdf57 Mon Sep 17 00:00:00 2001 From: Anthony Good Date: Sat, 13 Feb 2016 11:06:38 -0500 Subject: [PATCH] restructured library directory --- libraries/{ => HMC5883L}/HMC5883L.cpp | 0 libraries/{ => HMC5883L}/HMC5883L.h | 0 libraries/{ => LSM303}/LSM303.cpp | 0 libraries/{ => LSM303}/LSM303.h | 0 libraries/{ => PCF8583}/PCF8583.cpp | 0 libraries/{ => PCF8583}/PCF8583.h | 0 libraries/{ => RTClib}/RTClib.cpp | 0 libraries/{ => RTClib}/RTClib.h | 0 libraries/{ => TimerFive}/TimerFive.cpp | 0 libraries/{ => TimerFive}/TimerFive.h | 0 libraries/{ => TinyGPS}/TinyGPS.cpp | 0 libraries/{ => TinyGPS}/TinyGPS.h | 0 libraries/{ => hh12}/hh12.cpp | 0 libraries/{ => hh12}/hh12.h | 0 .../k3ng_remote_rotator_controller.cpp | 52 +++++ .../k3ng_remote_rotator_controller.h | 60 ++++++ libraries/{ => moon2}/moon2.cpp | 0 libraries/{ => moon2}/moon2.h | 0 libraries/{ => sunpos}/sunpos.cpp | 0 libraries/{ => sunpos}/sunpos.h | 0 rotator_pins_wb6kcn_az_test_setup.h | 194 ++++++++++++++++++ 21 files changed, 306 insertions(+) rename libraries/{ => HMC5883L}/HMC5883L.cpp (100%) rename libraries/{ => HMC5883L}/HMC5883L.h (100%) rename libraries/{ => LSM303}/LSM303.cpp (100%) rename libraries/{ => LSM303}/LSM303.h (100%) rename libraries/{ => PCF8583}/PCF8583.cpp (100%) rename libraries/{ => PCF8583}/PCF8583.h (100%) rename libraries/{ => RTClib}/RTClib.cpp (100%) rename libraries/{ => RTClib}/RTClib.h (100%) rename libraries/{ => TimerFive}/TimerFive.cpp (100%) rename libraries/{ => TimerFive}/TimerFive.h (100%) rename libraries/{ => TinyGPS}/TinyGPS.cpp (100%) rename libraries/{ => TinyGPS}/TinyGPS.h (100%) rename libraries/{ => hh12}/hh12.cpp (100%) rename libraries/{ => hh12}/hh12.h (100%) create mode 100755 libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.cpp create mode 100755 libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.h rename libraries/{ => moon2}/moon2.cpp (100%) rename libraries/{ => moon2}/moon2.h (100%) rename libraries/{ => sunpos}/sunpos.cpp (100%) rename libraries/{ => sunpos}/sunpos.h (100%) create mode 100755 rotator_pins_wb6kcn_az_test_setup.h diff --git a/libraries/HMC5883L.cpp b/libraries/HMC5883L/HMC5883L.cpp similarity index 100% rename from libraries/HMC5883L.cpp rename to libraries/HMC5883L/HMC5883L.cpp diff --git a/libraries/HMC5883L.h b/libraries/HMC5883L/HMC5883L.h similarity index 100% rename from libraries/HMC5883L.h rename to libraries/HMC5883L/HMC5883L.h diff --git a/libraries/LSM303.cpp b/libraries/LSM303/LSM303.cpp similarity index 100% rename from libraries/LSM303.cpp rename to libraries/LSM303/LSM303.cpp diff --git a/libraries/LSM303.h b/libraries/LSM303/LSM303.h similarity index 100% rename from libraries/LSM303.h rename to libraries/LSM303/LSM303.h diff --git a/libraries/PCF8583.cpp b/libraries/PCF8583/PCF8583.cpp similarity index 100% rename from libraries/PCF8583.cpp rename to libraries/PCF8583/PCF8583.cpp diff --git a/libraries/PCF8583.h b/libraries/PCF8583/PCF8583.h similarity index 100% rename from libraries/PCF8583.h rename to libraries/PCF8583/PCF8583.h diff --git a/libraries/RTClib.cpp b/libraries/RTClib/RTClib.cpp similarity index 100% rename from libraries/RTClib.cpp rename to libraries/RTClib/RTClib.cpp diff --git a/libraries/RTClib.h b/libraries/RTClib/RTClib.h similarity index 100% rename from libraries/RTClib.h rename to libraries/RTClib/RTClib.h diff --git a/libraries/TimerFive.cpp b/libraries/TimerFive/TimerFive.cpp similarity index 100% rename from libraries/TimerFive.cpp rename to libraries/TimerFive/TimerFive.cpp diff --git a/libraries/TimerFive.h b/libraries/TimerFive/TimerFive.h similarity index 100% rename from libraries/TimerFive.h rename to libraries/TimerFive/TimerFive.h diff --git a/libraries/TinyGPS.cpp b/libraries/TinyGPS/TinyGPS.cpp similarity index 100% rename from libraries/TinyGPS.cpp rename to libraries/TinyGPS/TinyGPS.cpp diff --git a/libraries/TinyGPS.h b/libraries/TinyGPS/TinyGPS.h similarity index 100% rename from libraries/TinyGPS.h rename to libraries/TinyGPS/TinyGPS.h diff --git a/libraries/hh12.cpp b/libraries/hh12/hh12.cpp similarity index 100% rename from libraries/hh12.cpp rename to libraries/hh12/hh12.cpp diff --git a/libraries/hh12.h b/libraries/hh12/hh12.h similarity index 100% rename from libraries/hh12.h rename to libraries/hh12/hh12.h diff --git a/libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.cpp b/libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.cpp new file mode 100755 index 0000000..430fe44 --- /dev/null +++ b/libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.cpp @@ -0,0 +1,52 @@ + +#ifndef K3NG_REMOTE_H +#define K3NG_REMOTE_H + +// K3NG_DISPLAY_LIBRARY_VERSION "1.0.2015061901" + + +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + +#include "k3ng_remote_rotator_controller.h" + + +uint8_t automatic_polling_active = 0; + + + +//----------------------------------------------------------------------------------------------------- + +K3NGremoteunit::K3NGremoteunit(){ + + + +} + +//----------------------------------------------------------------------------------------------------- + +void K3NGremoteunit::initialize(){ + + + + + +} + +//----------------------------------------------------------------------------------------------------- + +void K3NGremoteunit::service(){ + + + if (automatic_polling_active){ + + + } + + +} + +#endif //K3NG_REMOTE_H \ No newline at end of file diff --git a/libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.h b/libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.h new file mode 100755 index 0000000..9f84501 --- /dev/null +++ b/libraries/k3ng_remote_rotator_controller/k3ng_remote_rotator_controller.h @@ -0,0 +1,60 @@ + +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + + +#define K3NG_REMOTE_UNIT_LIBRARY_VERSION "1.0.2015061901" + +/* + + How this thing works.... + ++-----------+ +| |------serial/ethernet----->byte_in --> { } <-- send_command() +| remote | { class K3NGremoteunit } --> azimuth +| unit |<-----serial/ethernet-----byte_out <-- { } --> elevation +| | ++-----------+ + + +*/ + +class K3NGremoteunit { + +public: + + K3NGremoteunit(); + void initialize(); + void service(); + /* + void byte_in(uint8_t byte_received); + void byte_out(uint8_t byte_to_send); + uint8_t bytes_out_available(); + uint8_t send_command(uint8_t command_to_send); + uint8_t send_command(uint8_t command_to_send,float float_parameter); + void stop_automatic_polling(); + void resume_automatic_polling(); + + + unsigned long last_valid_response_received_time; + uint8_t link_state; + int poll_rate_ms; + + float azimuth; + float elevation; + uint8_t gps_state; + uint8_t azimuth_state; + uint8_t elevation_state;*/ + + + + + +private: + + + +}; \ No newline at end of file diff --git a/libraries/moon2.cpp b/libraries/moon2/moon2.cpp similarity index 100% rename from libraries/moon2.cpp rename to libraries/moon2/moon2.cpp diff --git a/libraries/moon2.h b/libraries/moon2/moon2.h similarity index 100% rename from libraries/moon2.h rename to libraries/moon2/moon2.h diff --git a/libraries/sunpos.cpp b/libraries/sunpos/sunpos.cpp similarity index 100% rename from libraries/sunpos.cpp rename to libraries/sunpos/sunpos.cpp diff --git a/libraries/sunpos.h b/libraries/sunpos/sunpos.h similarity index 100% rename from libraries/sunpos.h rename to libraries/sunpos/sunpos.h diff --git a/rotator_pins_wb6kcn_az_test_setup.h b/rotator_pins_wb6kcn_az_test_setup.h new file mode 100755 index 0000000..4be061b --- /dev/null +++ b/rotator_pins_wb6kcn_az_test_setup.h @@ -0,0 +1,194 @@ + + +/* AZ Test setup */ + + +/* ------------------------------------- Pin Definitions ------------------------------------------ + + You need to look at these and set them appropriately ! + + Most pins can be disabled by setting them to 0 (zero). If you're not using a pin or function, set it to 0. + + Pins > 99 = remote unit pin, for example: pin 109 = pin 9 on remote unit, pin A0+100 = pin A0 on remote unit + +*/ + +/* azimuth pins --------------------- (use just the azimuth pins for an azimuth-only rotator) */ + +#define rotate_cw 31 //6 // goes high to activate rotator R (CW) rotation - pin 1 on Yaesu connector +#define rotate_ccw 7 // goes high to activate rotator L (CCW) rotation - pin 2 on Yaesu connector +#define rotate_cw_ccw 35 // goes high for both CW and CCW rotation +#define rotate_cw_pwm 0 // optional - PWM CW output - set to 0 to disable (must be PWM capable pin) +#define rotate_ccw_pwm 0 // optional - PWM CCW output - set to 0 to disable (must be PWM capable pin) +#define rotate_cw_ccw_pwm 0 // optional - PWM on CW and CCW output - set to 0 to disable (must be PWM capable pin) +#define rotate_cw_freq 0 // optional - CW variable frequency output +#define rotate_ccw_freq 0 // optional - CCW variable frequency output +#define button_cw 49 //43 // normally open button to ground for manual CW rotation (schematic pin: A1) +#define button_ccw 45 //39 // normally open button to ground for manual CCW rotation (schematic pin: A2) +#define serial_led 0 // LED blinks when command is received on serial port (set to 0 to disable) +#define rotator_analog_az A0 // reads analog azimuth voltage from rotator - pin 4 on Yaesu connector +#define azimuth_speed_voltage 0 // optional - PWM output for speed control voltage feed into rotator (on continually unlike rotate_cw_pwm and rotate_ccw_pwm) +#define overlap_led 0 // line goes high when azimuth rotator is in overlap (> 360 rotators) +#define brake_az 0 // goes high to disengage azimuth brake (set to 0 to disable) +#define az_speed_pot 0 // connect to wiper of 1K to 10K potentiometer for speed control (set to 0 to disable) +#define az_preset_pot 0 // connect to wiper of 1K to 10K potentiometer for preset control (set to 0 to disable) +#define preset_start_button 0 // connect to momentary switch (ground on button press) for preset start (set to 0 to disable or for preset automatic start) +#define button_stop 41 // connect to momentary switch (ground on button press) for preset stop (set to 0 to disable or for preset automatic start) +#define rotation_indication_pin 47 +#define blink_led 0 +#define az_stepper_motor_pulse 29 //33 //0 +#define az_stepper_motor_direction 0//31 //37 + + +/*----------- elevation pins --------------*/ +#ifdef FEATURE_ELEVATION_CONTROL +#define rotate_up 0 // goes high to activate rotator elevation up +#define rotate_down 0 // goes high to activate rotator elevation down +#define rotate_up_or_down 27 // goes high when elevation up or down is activated +#define rotate_up_pwm 0 // optional - PWM UP output - set to 0 to disable (must be PWM capable pin) +#define rotate_down_pwm 0 // optional - PWM DOWN output - set to 0 to disable (must be PWM capable pin) +#define rotate_up_down_pwm 0 // optional - PWM on both UP and DOWN (must be PWM capable pin) +#define rotate_up_freq 0 // optional - UP variable frequency output +#define rotate_down_freq 0 // optional - UP variable frequency output +#define rotator_analog_el A1 // reads analog elevation voltage from rotator +#define button_up 0 //49 // normally open button to ground for manual up elevation +#define button_down 0 //45 // normally open button to ground for manual down rotation +#define brake_el 0 // goes high to disengage elevation brake (set to 0 to disable) +#define elevation_speed_voltage 0 // optional - PWM output for speed control voltage feed into rotator (on continually unlike rotate_up_pwm and rotate_down_pwm) +#define el_stepper_motor_pulse 33 //29 //0 //29 +#define el_stepper_motor_direction 37 //31 //0 //31 +#endif //FEATURE_ELEVATION_CONTROL + +// rotary encoder pins and options +#ifdef FEATURE_AZ_PRESET_ENCODER +#define az_rotary_preset_pin1 0 // CW Encoder Pin +#define az_rotary_preset_pin2 0 // CCW Encoder Pin +#endif //FEATURE_AZ_PRESET_ENCODER + +#ifdef FEATURE_EL_PRESET_ENCODER +#define el_rotary_preset_pin1 0 // UP Encoder Pin +#define el_rotary_preset_pin2 0 // DOWN Encoder Pin +#endif //FEATURE_EL_PRESET_ENCODER + +#ifdef FEATURE_AZ_POSITION_ROTARY_ENCODER +#define az_rotary_position_pin1 0 // CW Encoder Pin +#define az_rotary_position_pin2 0 // CCW Encoder Pin +#endif //FEATURE_AZ_POSITION_ROTARY_ENCODER + +#ifdef FEATURE_EL_POSITION_ROTARY_ENCODER +#define el_rotary_position_pin1 0 // CW Encoder Pin +#define el_rotary_position_pin2 0 // CCW Encoder Pin +#endif //FEATURE_EL_POSITION_ROTARY_ENCODER + +#ifdef FEATURE_AZ_POSITION_PULSE_INPUT +#define az_position_pulse_pin 0 // must be an interrupt capable pin! +#define AZ_POSITION_PULSE_PIN_INTERRUPT 0 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 +#endif // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts + +#ifdef FEATURE_EL_POSITION_PULSE_INPUT +#define el_position_pulse_pin 1 // must be an interrupt capable pin! +#define EL_POSITION_PULSE_PIN_INTERRUPT 1 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 +#endif // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts + +#ifdef FEATURE_PARK +#define button_park 0 +#endif + +//classic 4 bit LCD pins +#define lcd_4_bit_rs_pin 12 +#define lcd_4_bit_enable_pin 11 +#define lcd_4_bit_d4_pin 5 +#define lcd_4_bit_d5_pin 4 +#define lcd_4_bit_d6_pin 3 +#define lcd_4_bit_d7_pin 2 + + +#ifdef FEATURE_JOYSTICK_CONTROL +#define pin_joystick_x A0 +#define pin_joystick_y A1 +#endif //FEATURE_JOYSTICK_CONTROL + +#ifdef FEATURE_AZ_POSITION_HH12_AS5045_SSI +#define az_hh12_clock_pin 11 +#define az_hh12_cs_pin 12 +#define az_hh12_data_pin 13 +#endif //FEATURE_AZ_POSITION_HH_12 + +#ifdef FEATURE_EL_POSITION_HH12_AS5045_SSI +#define el_hh12_clock_pin 11 +#define el_hh12_cs_pin 12 +#define el_hh12_data_pin 13 +#endif //FEATURE_EL_POSITION_HH_12 + +#ifdef FEATURE_PARK +#define park_in_progress_pin 0 // goes high when a park has been initiated and rotation is in progress +#define parked_pin 0 // goes high when in a parked position +#endif //FEATURE_PARK + +#define heading_reading_inhibit_pin 0 // input - a high will cause the controller to suspend taking azimuth (and elevation) readings; use when RF interferes with sensors + +#ifdef FEATURE_LIMIT_SENSE +#define az_limit_sense_pin 0 // input - low stops azimuthal rotation +#define el_limit_sense_pin 0 // input - low stops elevation rotation +#endif //FEATURE_LIMIT_SENSE + +#ifdef FEATURE_AZ_POSITION_INCREMENTAL_ENCODER +#define az_incremental_encoder_pin_phase_a 2 //18 //3 must be an interrupt capable pin +#define az_incremental_encoder_pin_phase_b 3 //19 //3 // must be an interrupt capable pin +#define az_incremental_encoder_pin_phase_z 5 //15 //4 +#define AZ_POSITION_INCREMENTAL_ENCODER_A_PIN_INTERRUPT 0 //5 //0 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 +#define AZ_POSITION_INCREMENTAL_ENCODER_B_PIN_INTERRUPT 1 //4 //1 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 + // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts +#endif //FEATURE_AZ_POSITION_INCREMENTAL_ENCODER + +#ifdef FEATURE_EL_POSITION_INCREMENTAL_ENCODER +#define el_incremental_encoder_pin_phase_a 18 //2 //2 // must be an interrupt capable pin +#define el_incremental_encoder_pin_phase_b 19 //3 //3 // must be an interrupt capable pin +#define el_incremental_encoder_pin_phase_z 15 //5 //4 +#define EL_POSITION_INCREMENTAL_ENCODER_A_PIN_INTERRUPT 5 //0 //0 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 +#define EL_POSITION_INCREMENTAL_ENCODER_B_PIN_INTERRUPT 4 //1 //1 // Uno: pin 2 = interrupt 0, pin 3 = interrupt 1 ; Mega: pin 2 = interrupt 0, pin 3 = interrupt 1, pin 21 = interrupt 2, pin 20 = interrupt 3, pin 19 = interrupt 4, pin 18 = interrupt 5 + // read http://arduino.cc/en/Reference/AttachInterrupt for details on hardware and interrupts +#endif //FEATURE_EL_POSITION_INCREMENTAL_ENCODER + +#ifdef FEATURE_YOURDUINO_I2C_LCD +#define En_pin 2 +#define Rw_pin 1 +#define Rs_pin 0 +#define D4_pin 4 +#define D5_pin 5 +#define D6_pin 6 +#define D7_pin 7 +#endif //FEATURE_YOURDUINO_I2C_LCD + +#ifdef FEATURE_MOON_TRACKING +#define moon_tracking_active_pin 0 // goes high when moon tracking is active +#define moon_tracking_activate_line 0 // ground this pin to activate moon tracking (not for use with a button) +#define moon_tracking_button 0 // use with a normally open momentary switch to ground +#endif //FEATURE_MOON_TRACKING + +#ifdef FEATURE_SUN_TRACKING +#define sun_tracking_active_pin 0 // goes high when sun tracking is active +#define sun_tracking_activate_line 0 // ground this pin to activate sun tracking (not for use with a button) +#define sun_tracking_button 0 // use with a normally open momentary switch to ground +#endif //FEATURE_SUN_TRACKING + +#ifdef FEATURE_GPS +#define gps_sync 0 +#endif //FEATURE_GPS + +#ifdef FEATURE_POWER_SWITCH +#define power_switch 0 // use with FEATURE_POWER_SWITCH +#endif //FEATURE_POWER_SWITCH + +#ifdef FEATURE_EL_POSITION_MEMSIC_2125 +#define pin_memsic_2125_x 0 +#define pin_memsic_2125_y 0 +#endif //FEATURE_EL_POSITION_MEMSIC_2125 + +#ifdef FEATURE_ANALOG_OUTPUT_PINS +#define pin_analog_az_out 0 +#define pin_analog_el_out 0 +#endif //FEATURE_ANALOG_OUTPUT_PINS + + +