Minimize contract, add ADC read and send its data to coonsole

This commit is contained in:
2026-04-13 00:04:48 +03:00
parent 732a2dfa32
commit 977227296e
12 changed files with 269 additions and 67 deletions

19
esp32/main/ringbuf.h Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <stdint.h>
#define RINGBUF_SIZE 10
typedef struct {
int values[RINGBUF_SIZE];
int head;
} ringbuf_t;
// Инициализация
void ringbuf_init(ringbuf_t *rb);
// Добавить значение
void ringbuf_push(ringbuf_t *rb, int v);
// Скопировать данные (в порядке времени)
void ringbuf_copy(const ringbuf_t *rb, int *out);