/*
 * led_receptor.h
 *
 * Created: 03/12/2021 14:29:30
 *  Author: 40008304
 */ 


#ifndef LED_RECEPTOR_H_
#define LED_RECEPTOR_H_

#include "led_gen.h"
#include "usiTwiSlave.h"
#define F_CPU 16000000
#include <util/delay.h>
#include <avr/interrupt.h>

#define FRONT	0x51
#define RIGHT	0x52
#define LEFT	0x53
#define NOTHING	0x54
#define ERROR	0xF0
#define VOLTMIN	4
#define TIMING 10

void ADC_init(void);
void ADC_start_conversion(void);
char ADC_read_value(void);
float ADC_averaging(unsigned char val_ana);
char measureLed1(void);
char measureLed2(void);
unsigned char compareLed(int led1,int led2);

volatile unsigned char intr_count;
volatile unsigned char timer_flag;
volatile unsigned char seconde;

volatile unsigned char ledresult1;
volatile unsigned char ledresult2;

#endif /* LED_RECEPTOR_H_ */