Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Schematic export and demo
  • Loading branch information
DanKoloff committed Jul 4, 2023
1 parent 20b327b commit f286524
Show file tree
Hide file tree
Showing 10 changed files with 3,794 additions and 0 deletions.
Binary file not shown.
6 changes: 6 additions & 0 deletions SOFTWARE/ESP-IDF/ESP32-C6-EVB_Blink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ESP32-C6-EVB_Blink)
Binary file not shown.
31 changes: 31 additions & 0 deletions SOFTWARE/ESP-IDF/ESP32-C6-EVB_Blink/ESP32-C6-EVB_README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
This demo was made with ESP-IDF version 5.0.1

What it does?

It turns on a relay for a second, then turns it off, then turns on the next relay, then turns it off. USER_LED1 is also turned on when relay 2 and relay 4 are on. If you press and hold the button BUT1, the LED sequnece gets paused.

How to compile and download?

First make sure that the board is properly recognized and lisited in your operating system. Make sure to force the program/bootloader mode by holding button BUT1 then press RST1 and release BUT1. Install drivers if needed.

Under "Windows" this should be listed as "Composite Device" and you should see "USB JTAG/serial debug unit (interface ...) (COMX)" in the "Windows Device Manager".

Set the chip we are about to program to ESP32-C6:

idf.py set-target esp32c6

If you want to change anything about the application from the menu:

idf.py menuconfig

Build the project:

idf.py build

In order to flash the board you need to set it in bootloader mode (hold the button BUT on power-up/reset then release it).

idf.py flash -p COMX

To run the program you need to restart the board.

If you have trouble with compilation use the prebuilt file "ESP32-C6-EVB_Blink.bin".
15 changes: 15 additions & 0 deletions SOFTWARE/ESP-IDF/ESP32-C6-EVB_Blink/dependencies.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
espressif/led_strip:
component_hash: 1f8cc130ebd557fde64c02fe5fad0cb36d69947498c540ace6f425e1083d7773
source:
service_url: https://api.components.espressif.com/
type: service
version: 2.4.1
idf:
component_hash: null
source:
type: idf
version: 5.2.0
manifest_hash: a9cfca33ead099a7bed61788ae0ab562f9f28d5e440bb09d115a3de63fbaf3c1
target: esp32c6
version: 1.0.0
2 changes: 2 additions & 0 deletions SOFTWARE/ESP-IDF/ESP32-C6-EVB_Blink/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
idf_component_register(SRCS "ESP32-C6-EVB_Blink.c"
INCLUDE_DIRS ".")
58 changes: 58 additions & 0 deletions SOFTWARE/ESP-IDF/ESP32-C6-EVB_Blink/main/ESP32-C6-EVB_Blink.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* Blink 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 "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "led_strip.h"
#include "sdkconfig.h"

#define LED 8
#define BUTTON 9
#define NUMBER_OF_RELAYS 4
const char Output[NUMBER_OF_RELAYS] = {10, 11, 22, 23};

static void Init_GPIO(void)
{
int i;
for (i=0; i<4; i++)
{
gpio_reset_pin(Output[i]);
gpio_set_direction(Output[i], GPIO_MODE_INPUT_OUTPUT);

}
gpio_reset_pin(LED);
gpio_set_direction(LED, GPIO_MODE_INPUT_OUTPUT);

gpio_reset_pin(BUTTON);
gpio_set_direction(BUTTON, GPIO_MODE_INPUT);
}


void app_main(void)
{
int i, ActiveRelay=0;
Init_GPIO();

while (1)
{
for (i=0; i<NUMBER_OF_RELAYS; i++)
if (i == ActiveRelay) // check the active relay
gpio_set_level (Output[i], 1); // turn on the active relay
else
gpio_set_level (Output[i], 0); // turn off the others

gpio_set_level (LED, !gpio_get_level(LED)); // toggle LED
vTaskDelay(1000 / portTICK_PERIOD_MS); // short delay (1 sec)

while (!gpio_get_level (BUTTON)); // wait while the button is hold down
ActiveRelay=(ActiveRelay+1)%NUMBER_OF_RELAYS; // change the active relay 0 to 3
}
}
2 changes: 2 additions & 0 deletions SOFTWARE/ESP-IDF/ESP32-C6-EVB_Blink/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
espressif/led_strip: "^2.0.0"
Loading

0 comments on commit f286524

Please sign in to comment.