2023-01-16 17:55:16 -05:00
|
|
|
/* i2c - Simple example
|
|
|
|
|
|
|
|
Simple I2C example that shows how to initialize I2C
|
|
|
|
as well as reading and writing from and to registers for a sensor connected over I2C.
|
|
|
|
|
|
|
|
For other examples please check:
|
|
|
|
https://github.com/espressif/esp-idf/tree/master/examples
|
|
|
|
|
|
|
|
See README.md file to get detailed usage of this example.
|
|
|
|
|
|
|
|
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, this
|
|
|
|
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
*/
|
|
|
|
#include <stdio.h>
|
2023-05-09 23:30:24 -04:00
|
|
|
#include <string.h>
|
2023-01-16 17:55:16 -05:00
|
|
|
#include "esp_log.h"
|
|
|
|
#include "driver/i2c.h"
|
2023-01-31 12:14:01 -05:00
|
|
|
#include "driver/gpio.h"
|
2023-01-16 17:55:16 -05:00
|
|
|
|
2023-01-18 00:34:51 -05:00
|
|
|
// Include FreeRTOS for delay
|
|
|
|
#include <freertos/FreeRTOS.h>
|
|
|
|
#include <freertos/task.h>
|
|
|
|
|
2023-05-10 18:20:37 -04:00
|
|
|
#include "system.h"
|
2023-01-16 17:55:16 -05:00
|
|
|
|
2023-05-10 18:20:37 -04:00
|
|
|
static const char *TAG = "main";
|
2023-01-16 17:55:16 -05:00
|
|
|
|
2023-05-10 18:20:37 -04:00
|
|
|
TaskHandle_t sysTaskHandle = NULL;
|
2023-01-16 17:55:16 -05:00
|
|
|
|
2023-05-10 18:20:37 -04:00
|
|
|
void app_main(void) {
|
|
|
|
ESP_LOGI(TAG, "Welcome to The bitaxe!");
|
2023-01-16 17:55:16 -05:00
|
|
|
|
2023-05-10 18:20:37 -04:00
|
|
|
xTaskCreate(SysTask, "System_Task", 4096, NULL, 10, &sysTaskHandle);
|
2023-01-19 22:17:36 -05:00
|
|
|
|
2023-01-16 17:55:16 -05:00
|
|
|
}
|