|
|
|
|
@ -22,7 +22,7 @@
|
|
|
|
|
|
|
|
|
|
#include "util/delay.h"
|
|
|
|
|
|
|
|
|
|
#define PLC_MQTT_ENABLED 1
|
|
|
|
|
#define PLC_MQTT_ENABLED 0
|
|
|
|
|
|
|
|
|
|
Client mqtt_client;
|
|
|
|
|
|
|
|
|
|
@ -249,6 +249,17 @@ int main(){
|
|
|
|
|
modbus_io_set_Output(4, MOD_OUT_HEIZEN_LED, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(read_Input(BTN_LIFT_UP, LEVEL)){
|
|
|
|
|
set_Output(LIFT_MOTOR_DIR, 1);
|
|
|
|
|
TCCR3B |= _BV(CS31);
|
|
|
|
|
}
|
|
|
|
|
else if(read_Input(BTN_LIFT_DOWN, LEVEL)){
|
|
|
|
|
set_Output(LIFT_MOTOR_DIR, 0);
|
|
|
|
|
TCCR3B |= _BV(CS31);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
TCCR3B &= ~_BV(CS31);
|
|
|
|
|
|
|
|
|
|
#if PLC_MQTT_ENABLED
|
|
|
|
|
// send misc info
|
|
|
|
|
if(millis() - timer_send_uptime > 5000){
|
|
|
|
|
@ -323,7 +334,6 @@ void timer3_init()
|
|
|
|
|
OCR3B = 50;
|
|
|
|
|
|
|
|
|
|
DDRE |= 1 << 4;
|
|
|
|
|
TCCR3B |= _BV(CS31);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initADC(void)
|
|
|
|
|
@ -342,7 +352,7 @@ static void avr_init(void)
|
|
|
|
|
wdt_reset(); // wdt reset ~ every <2000ms
|
|
|
|
|
|
|
|
|
|
timer0_init();// Timer0 millis engine init
|
|
|
|
|
//timer3_init();
|
|
|
|
|
timer3_init();
|
|
|
|
|
DDRL |= 1<<6;
|
|
|
|
|
uart_init();
|
|
|
|
|
|
|
|
|
|
|