manual spooling when button is held down
This commit is contained in:
15
spule.c
15
spule.c
@@ -50,6 +50,14 @@ static void spule_onoff(uint8_t state){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_spooling_speed(uint16_t speed){
|
||||||
|
ICR5=speed;
|
||||||
|
OCR5C = ICR5/2;
|
||||||
|
|
||||||
|
ICR1 = ICR5/TRANS_ROT_FACTOR;
|
||||||
|
OCR1A = ICR1/2;
|
||||||
|
}
|
||||||
|
|
||||||
void do_spule(){
|
void do_spule(){
|
||||||
//PORTH &= ~(1<<5);
|
//PORTH &= ~(1<<5);
|
||||||
if(read_Input(IN_SPULE_HOME, LEVEL) && spule_trans_homed == 0){
|
if(read_Input(IN_SPULE_HOME, LEVEL) && spule_trans_homed == 0){
|
||||||
@@ -69,7 +77,12 @@ void do_spule(){
|
|||||||
set_Output(MOTOR_TRANS_DIR, 1); // direction: front
|
set_Output(MOTOR_TRANS_DIR, 1); // direction: front
|
||||||
TCCR1B |= _BV(CS11); //TURN ON
|
TCCR1B |= _BV(CS11); //TURN ON
|
||||||
}
|
}
|
||||||
else if(taenzer_state.pos <= 10){
|
else if(!get_abzug_state()){
|
||||||
|
if(read_Input(BTN_WICKELN_EIN, LEVEL)){
|
||||||
|
set_spooling_speed(300);
|
||||||
|
spule_onoff(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
spule_onoff(0);
|
spule_onoff(0);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Reference in New Issue
Block a user