#include #include #include "avrIOhelper/io-helper.h" #include "common.h" uint16_t abzug_speed = 100; void timer3_init() { TCCR3A |= (1<= 20) abzug_speed -= 10; else abzug_speed = 10; #if PLC_MQTT_ENABLED send_settings(); #endif } if (read_Input(BTN_ABZUG_PLUS_FEIN, RISING)) { if(abzug_speed <= 999) abzug_speed += 1; else abzug_speed = 1000; #if PLC_MQTT_ENABLED send_settings(); #endif } if (read_Input(BTN_ABZUG_MINUS_FEIN, RISING)) { if(abzug_speed >= 11) abzug_speed -= 1; else abzug_speed = 10; #if PLC_MQTT_ENABLED send_settings(); #endif } // 16000000/8 ICR3 = ((1.0/abzug_speed)*3.14*42.0*(1.0/5.0))*2.0*500.0*(1/1.03); OCR3B = ICR3/2; }