mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-21 23:31:44 +01:00
39 lines
1.0 KiB
C
Executable File
39 lines
1.0 KiB
C
Executable File
/* 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>
|
|
#include <string.h>
|
|
#include "esp_log.h"
|
|
#include "driver/i2c.h"
|
|
#include "driver/gpio.h"
|
|
|
|
// Include FreeRTOS for delay
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/task.h>
|
|
|
|
#include "system.h"
|
|
|
|
static const char *TAG = "main";
|
|
|
|
TaskHandle_t sysTaskHandle = NULL;
|
|
|
|
void app_main(void) {
|
|
ESP_LOGI(TAG, "Welcome to The bitaxe!");
|
|
|
|
xTaskCreate(SysTask, "System_Task", 4096, NULL, 10, &sysTaskHandle);
|
|
|
|
}
|