#include <stdint.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include "hwapi.h"
const uint8_t DEBOUNCE = 7; // DEBOUNCE_TIME = DEBOUNCE x (4.1ms + 17*0.6ms + 0,3ms)
volatile uint8_t channels = 0x55;
volatile uint8_t frameCount = 0;
//#include "iom328p.h"
void setup() {
init();
}
void loop() {
const uint8_t DEBOUNCE = 7;
init();
while (1) {
if (frameCount > DEBOUNCE) {
channels = PIND;
frameCount = 0;
}
}
}