modified: main/src/leds.c
modified: main/src/sensor.c
This commit is contained in:
1 parent
075bc3e261
commit
561278883e
2 files changed
+7
-4
No files matched your search
@@ -34,7 +34,7 @@ void led_blink_task(void *pvParameter)
|
|||||||
unsigned initLEDs() {
|
unsigned initLEDs() {
|
||||||
gpio_set_direction(LED1,GPIO_MODE_OUTPUT);
|
gpio_set_direction(LED1,GPIO_MODE_OUTPUT);
|
||||||
gpio_set_direction(LED2,GPIO_MODE_OUTPUT);
|
gpio_set_direction(LED2,GPIO_MODE_OUTPUT);
|
||||||
gpio_set_direction(LED_INT,GPIO_MODE_OUTPUT);
|
//gpio_set_direction(LED_INT,GPIO_MODE_OUTPUT);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
#include "sensor.h"
|
#include "sensor.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include "driver/i2c.h"
|
||||||
|
|
||||||
|
#define SDA_PIN GPIO_NUM_2
|
||||||
|
#define CLK_PIN GPIO_NUM_14
|
||||||
|
#define SENSOR_ADDR 0x45 //default address is 0x44 (pin 2 logic low). We chose 0x45 with logic high
|
||||||
|
|
||||||
#define I2C_SDA_PIN GPIO_NUM_2
|
|
||||||
#define I2C_CLK_PIN GPIO_NUM_14
|
|
||||||
|
|
||||||
// Dummy implementations for the purpose of this example
|
// Dummy implementations for the purpose of this example
|
||||||
// Replace these with actual sensor initialization and data retrieval logic
|
// Replace these with actual sensor initialization and data retrieval logic
|
||||||
|
|
||||||
// Function to initialize the sensor
|
// Function to initialize the sensor
|
||||||
void initialize(void) {
|
void initSensor(void) {
|
||||||
// Initialize the sensor hardware
|
// Initialize the sensor hardware
|
||||||
// For example, set up I2C communication, configure registers, etc.
|
// For example, set up I2C communication, configure registers, etc.
|
||||||
printf("Sensor initialized.\n");
|
printf("Sensor initialized.\n");
|
||||||
|
|||||||
Reference in new issue
Block a user