Move source code to /firmware and fix build paths

This commit is contained in:
2025-05-15 15:51:46 +02:00
parent 6dd4b87a0f
commit 412354fe88
9 changed files with 8 additions and 4 deletions
+11
View File
@@ -0,0 +1,11 @@
#ifndef ADC_H
#define ADC_H
#include <stdint.h>
#include <avr/io.h>
#include <avr/interrupt.h>
void adcInit(void);
uint16_t adcRead(uint8_t channel);
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef CONFIG_H
#define CONFIG_H
#define MOISTURE_SENSOR_A0 PC0
#define MOISTURE_SENSOR_A1 PC1
#define MOISTURE_SENSOR_A2 PC2
#define MOISTURE_SENSOR_A3 PC3
#define MOISTURE_SENSOR_A4 PC4
#define MOISTURE_SENSOR_A5 PC5
// NOTE: PC6 PC7 are not accessible by default on Arduino Uno R3
// You need to use the ATMega328p on a custom PCB and use pins 1 and 2
//#define MOISTURE_SENSOR_A6 PC6
//#define MOISTURE_SENSOR_A7 PC7
#define SENSOR_READINGS 5
#define SENSORS_NUM 6
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef MOISTURE_H
#define MOISTURE_H
#include <stdint.h>
#include <stdbool.h>
void initMoistureSensors(void);
void triggerSensorsRead(void);
int16_t moistureSensorsAverage(int8_t sensorPin);
int16_t readMoisture(void);
extern volatile bool readSensors;
#endif