Compare commits
3 commits
b21a8fbecf
...
4dcfb1ea07
Author | SHA1 | Date | |
---|---|---|---|
|
4dcfb1ea07 | ||
|
4adeec5219 | ||
|
17bd1a4e38 |
3 changed files with 10 additions and 4 deletions
|
@ -49,6 +49,8 @@
|
||||||
#define SPEED_PIN PB2 // Pin 7/ADC1
|
#define SPEED_PIN PB2 // Pin 7/ADC1
|
||||||
#define BUTTON_PIN PB4 // Pin 3 - Button input
|
#define BUTTON_PIN PB4 // Pin 3 - Button input
|
||||||
|
|
||||||
|
#define MOTOR_PULSE 1 //uS motor base pulse
|
||||||
|
|
||||||
|
|
||||||
/*The timing of "ticks" is dependent on the AVR timer's counter register
|
/*The timing of "ticks" is dependent on the AVR timer's counter register
|
||||||
* so for an 8bit register the maximum value is 256. Given we stick with
|
* so for an 8bit register the maximum value is 256. Given we stick with
|
||||||
|
|
|
@ -3,8 +3,8 @@ add_executable(${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
RegEdit
|
#RegEdit
|
||||||
timer
|
#timer
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ensure the build rules are defined
|
# Ensure the build rules are defined
|
||||||
|
|
|
@ -152,9 +152,13 @@ void MotorMoveTo(uint8_t target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The delay ratio controlls the PWM waveforms.
|
// The delay ratio controlls the PWM waveforms.
|
||||||
_delay_ms((double)on_delay);
|
for(uint8_t i = 0; i < on_delay; i++){
|
||||||
|
_delay_us(MOTOR_PULSE);
|
||||||
|
}
|
||||||
MotorCoast();
|
MotorCoast();
|
||||||
_delay_ms((double)off_delay);
|
for(uint8_t i = 0; i < off_delay; i++){
|
||||||
|
_delay_us(MOTOR_PULSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue