Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete code re-write plus new feature (frequency control) #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Nov 15, 2019

  1. Configuration menu
    Copy the full SHA
    0503e73 View commit details
    Browse the repository at this point in the history
  2. Add TimeFrame_V4_0_full.ino

    This a complete re-write of the sketch with the following changes:
    
       - More comments to help reader understand how it works
       - More use of named constants for readability
       - More use of functions for readability
       - Better constant and variable names
       - Unnecessary code removed
       - On-board LED heartbeat is now always on, but code rewritten to
         not interfere with timing
       - Implementation of Paul Hutchison's improvements:
           - Glowing LED for pushbutton (OPTIONAL)
           - Frame starts in standby mode
           - Removed LED only mode
           - Additional analog input to control electromagnet duty
             (OPTIONAL)
           - Adjustments to ranges
       - NEW FEATURE: frequency control
    
    Note that this sketch is compatible with with both the original hardware
    design and with either or both of the hardware modifications added by
    Paul Hutchison (pushbutton LED and electromagnet strength knob.)
    However, the constants HW_HAS_PUSHBUTTON_LED and
    HW_HAS_MAG_STRENGTH_KNOB must be set appropriately below.
    
    The frequency control feature uses the same knob (potentiometer) as the
    LED brightness. The ability to vary the frequency allows the user to
    find the resonant frequency of the object(s). Frequency control mode is
    entered by "double clicking" the pushbutton when it is in the standby
    mode. The LED brightness value is captured on entry to the frequency
    control mode, and the knob is temporarily re-purposed to control the
    frequency. The speed control knob and the electromagnet strength knob
    work as normal while in frequency control mode. Frequency control mode
    is exited and normal slow motion mode is entered when the pushbutton is
    pressed. At this transition, the frequency value is captured and
    continues to be used while the frame is powered on. Additionally, the
    value is written to EEPROM. This value is read the next time the frame
    is powered on and is used until the user enters frequency control mode
    again to change it.
    
    In frequency control mode, the pushbutton LED blinks rapidly. On
    hardware that does not implement the pushbutton LED, the only way to
    tell that it is in frequency control mode is to go ahead and turn the
    knob that normally controls the brightness and see if it instead is
    controlling the frequency.
    csatt committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    e9e4e6c View commit details
    Browse the repository at this point in the history
  3. Revert spelling fix

    csatt committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    c728227 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. Restore "Magnet Off" mode

    Restored the mode that Paul Hutchison had removed in which the magnet is turned off and only the LED strip is on. However, there is a constant INCLUDE_MAGNET_OFF_MODE that may be set to "false" to skip this mode.
    
    Also renumbered the modes to be in their more logical order. This is purely cosmetic; the current code doesn't even require the numerical values to be consecutive.
    csatt committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    dc317f5 View commit details
    Browse the repository at this point in the history
  2. Change some constants

    The PUSHBUTTON_LED_STANDBY_PERIOD_MS constant is change from 2000 to 3000 to slow the "throbbing" down even more (personal preference).
    
    The BASE_FREQ_HZ and FREQ_RANGE_HZ are changed to 77.0 and 14.0 respectively. This gives a frequency range from 70 Hz to 84 Hz, tunable in the new frequency control mode.
    csatt committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    b39a7f4 View commit details
    Browse the repository at this point in the history
  3. Two tiny cosmetic changes

    Fixed one comment and one blank line.
    csatt committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    a37ee26 View commit details
    Browse the repository at this point in the history