mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-13 15:10:12 +00:00
ESP-IDF Robot Controls
This commit is contained in:
@@ -723,6 +723,25 @@ void app_main(void)
|
|||||||
espnow_init();
|
espnow_init();
|
||||||
//esp_now_add_peer(&peerInfo);
|
//esp_now_add_peer(&peerInfo);
|
||||||
|
|
||||||
|
/*
|
||||||
|
ADC
|
||||||
|
*/
|
||||||
|
esp_err_t ret;
|
||||||
|
uint32_t ret_num = 0;
|
||||||
|
uint8_t result[READ_LEN] = {0};
|
||||||
|
memset(result, 0xcc, EXAMPLE_READ_LEN);
|
||||||
|
|
||||||
|
s_task_handle = xTaskGetCurrentTaskHandle();
|
||||||
|
|
||||||
|
adc_continuous_handle_t handle = NULL;
|
||||||
|
continuous_adc_init(channel, sizeof(channel) / sizeof(adc_channel_t), &handle);
|
||||||
|
|
||||||
|
adc_continuous_evt_cbs_t cbs = {
|
||||||
|
.on_conv_done = s_conv_done_cb,
|
||||||
|
};
|
||||||
|
ESP_ERROR_CHECK(adc_continuous_register_event_callbacks(handle, &cbs, NULL));
|
||||||
|
ESP_ERROR_CHECK(adc_continuous_start(handle));
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF");
|
ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF");
|
||||||
//blink_led();
|
//blink_led();
|
||||||
|
Reference in New Issue
Block a user