You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
			
		
		
		
		
			
		
			
				
	
	
		
			31 lines
		
	
	
		
			578 B
		
	
	
	
		
			C
		
	
			
		
		
	
	
			31 lines
		
	
	
		
			578 B
		
	
	
	
		
			C
		
	
| #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;
 | |
|     }
 | |
| }
 |