Elevator v2.0
Elevator Documenation
Loading...
Searching...
No Matches
pressure_sensor.h
Go to the documentation of this file.
1
11#ifndef _PRESSURE_SENSOR_H_
12#define _PRESSURE_SENSOR_H_
13
14#include <stdio.h>
15#include "freertos/FreeRTOS.h"
16#include "freertos/task.h"
17#include "driver/adc.h"
18
19#define PRESSURE_SENSOR_ADC_WIDTH (adc_bits_width_t)(ADC_WIDTH_BIT_12) // ADC width of 12 Bits 2**12 - 1
20#define PRESSURE_SENSOR_CH ADC1_CHANNEL_5 // pressure sensor channel
21#define PRESSURE_SENSOR_ADC_ATTEN (adc_atten_t)(ADC_ATTEN_DB_11) // ADC attenuation set at 11 for range of 2600mV
22#define PRESSURE_SENSOR_THRESHOLD 2500 //pressure sensor threshold
23
39typedef struct {
40 adc_bits_width_t width;
41 adc1_channel_t channel;
42 adc_atten_t atten;
44
51
59#endif
void pressureSensorInit(PressureSensor *ps)
PressureSensor initialization for force-sensitive sensor.
Definition: pressure_sensor.c:24
int read_pressure_sensor(PressureSensor *ps)
Read channel of the PressureSensor.
Definition: pressure_sensor.c:35
PressureSensor structure for Force-Sensitive Sensor.
Definition: pressure_sensor.h:39
adc1_channel_t channel
Definition: pressure_sensor.h:41
adc_bits_width_t width
Definition: pressure_sensor.h:40
adc_atten_t atten
Definition: pressure_sensor.h:42