-
Notifications
You must be signed in to change notification settings - Fork 35
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
csatt
wants to merge
6
commits into
cubic-print:master
Choose a base branch
from
csatt:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Nov 15, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 0503e73 - Browse repository at this point
Copy the full SHA 0503e73View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for e9e4e6c - Browse repository at this point
Copy the full SHA e9e4e6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c728227 - Browse repository at this point
Copy the full SHA c728227View commit details
Commits on Nov 21, 2019
-
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.
Configuration menu - View commit details
-
Copy full SHA for dc317f5 - Browse repository at this point
Copy the full SHA dc317f5View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b39a7f4 - Browse repository at this point
Copy the full SHA b39a7f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for a37ee26 - Browse repository at this point
Copy the full SHA a37ee26View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.