Files @ 24d49dea991a
Branch filter:

Location: protofusion-esp32-template/main/squeeze.h

Ethan Zonca
Add runtime modes and seperate squeezy triggers
#ifndef _SQUEEZE_H
#define _SQUEEZE_H



// Definitions
#define ALPHA_FAST 0.02f
#define ALPHA_SLOW 0.005f

// Private variables
typedef struct squeezable_
{
    uint32_t adc_channel;
    float reading_fast;
    float reading_slow;
    float delta_last;
    uint8_t triggered_flag;

} squeezable_t;

typedef enum squeezable_id_
{
    SQUEEZABLE_HEART = 0,
    SQUEEZABLE_BRAIN,
    SQUEEZABLE_MAX
} squeezable_id_t;


void squeeze_init(void);
float squeeze_value(squeezable_id_t id);
uint8_t squeeze_triggered(squeezable_id_t id);



#endif