Compare commits
4 commits
b93a01f8c5
...
ce747adb9a
Author | SHA1 | Date | |
---|---|---|---|
|
ce747adb9a | ||
|
6d73b3f8aa | ||
|
d7049191bc | ||
|
3fa844b719 |
4 changed files with 10 additions and 3 deletions
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20)
|
|||
|
||||
# Use the fancy version substitution
|
||||
project(main
|
||||
VERSION 0.2.4
|
||||
VERSION 0.3.1
|
||||
DESCRIPTION "template for cmake + cpputest"
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
|
|
|
@ -36,6 +36,12 @@ The speed can be adjusted by changing the input value of the speed pot. The
|
|||
speed adjustment affects the on/off ratio of the motor and has a programmed
|
||||
minimum speed value in the function to prevent endless looping.
|
||||
|
||||
### Move to secondary Position
|
||||
|
||||
When the motor has already preformed a move to position from a quick
|
||||
button press, you can tap the button once more and it will go back to it's
|
||||
previous position from your initial button press.
|
||||
|
||||
|
||||
## Building Project(Windows)
|
||||
|
||||
|
|
|
@ -49,9 +49,10 @@
|
|||
#define SPEED_PIN PB2 // Pin 7/ADC1
|
||||
#define BUTTON_PIN PB4 // Pin 3 - Button input
|
||||
|
||||
#define MOTOR_RAMPDOWN_DIST 16
|
||||
#define MOTOR_RAMPDOWN_DIST 32
|
||||
#define MOTOR_PULSE 6 //uS motor base pulse
|
||||
|
||||
#define SAVED_POS_MARGIN 4
|
||||
|
||||
|
||||
/*The timing of "ticks" is dependent on the AVR timer's counter register
|
||||
|
|
|
@ -284,7 +284,7 @@ static void UpdateButtonOutput(btn_state *b) {
|
|||
if (b->is_active) {
|
||||
|
||||
/*If already in saved position then go back to original pos.*/
|
||||
if(diff(MotorGetSavedPos((uint8_t *)POSITION1_ADR), ReadFader()) <= 3){
|
||||
if(diff(MotorGetSavedPos((uint8_t *)POSITION1_ADR), ReadFader()) <= SAVED_POS_MARGIN){
|
||||
MotorMoveTo(MotorGetSavedPos((uint8_t *)POSITION2_ADR));
|
||||
}
|
||||
else{
|
||||
|
|
Loading…
Add table
Reference in a new issue