esp32-car/include/ir.h

26 lines
326 B
C
Raw Normal View History

2024-12-27 11:32:09 +08:00
#ifndef IR_H
#define IR_H
2025-01-01 17:53:59 +08:00
#include <Wire.h>
2024-12-27 11:32:09 +08:00
#include <Arduino.h>
2025-01-01 17:53:59 +08:00
#include <algorithm>
2025-01-01 13:21:24 +08:00
#include "consts.h"
2024-12-27 11:32:09 +08:00
struct IRData
{
2025-01-01 19:30:56 +08:00
uint8_t mode;
2025-01-01 13:21:24 +08:00
uint8_t pins[IR_COUNT];
uint8_t count;
2024-12-27 11:32:09 +08:00
uint8_t data[8];
};
class IR
{
public:
2025-01-01 17:53:59 +08:00
static TwoWire *i2c;
2024-12-27 11:32:09 +08:00
static IRData data;
2025-01-01 13:21:24 +08:00
static void init();
2024-12-27 11:32:09 +08:00
static void update();
};
#endif