add files for spooling motion
parent
8a759f7f21
commit
f590396e0c
@ -0,0 +1,30 @@
|
|||||||
|
#include <avr/io.h>
|
||||||
|
#include "avrIOhelper/io-helper.h"
|
||||||
|
|
||||||
|
void timer5_init()
|
||||||
|
{
|
||||||
|
TCCR5A |= (1<<COM5C1);
|
||||||
|
TCCR5B |= _BV(WGM53);
|
||||||
|
|
||||||
|
ICR5 = 500;
|
||||||
|
OCR5C = 250;
|
||||||
|
|
||||||
|
DDRL |= 1 << 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
void do_spule(){
|
||||||
|
if (read_Input(BTN_WICKELN_EIN, RISING)) {
|
||||||
|
TCCR5B |= _BV(CS51); //TURN ON
|
||||||
|
}
|
||||||
|
if (read_Input(BTN_WICKELN_AUS, RISING)) {
|
||||||
|
TCCR5B &= ~(_BV(CS51));
|
||||||
|
}
|
||||||
|
if (read_Input(BTN_TAENZER_START, RISING)) {
|
||||||
|
ICR5-=15;
|
||||||
|
OCR5C = ICR5/2;
|
||||||
|
}
|
||||||
|
if (read_Input(BTN_SPULENWECHSEL, RISING)) {
|
||||||
|
ICR5+=15;
|
||||||
|
OCR5C = ICR5/2;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue