manual spooling when button is held down

master
Eggert Jung 3 years ago
parent 1ad6f56a9d
commit dcf1531033

@ -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,8 +77,13 @@ 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()){
spule_onoff(0); if(read_Input(BTN_WICKELN_EIN, LEVEL)){
set_spooling_speed(300);
spule_onoff(1);
}
else
spule_onoff(0);
} }
else{ else{
/* speed regulation - keep taenzer at 10% */ /* speed regulation - keep taenzer at 10% */