MahdaSystem / TM1638

TM1638 driver for AVR (ATmega32), STM32 (HAL) and ESP32 (esp-idf)
MIT License
16 stars 9 forks source link

Add ESP-IDF examples and config files #3

Open hayschan opened 1 year ago

hayschan commented 1 year ago

ESP32 MCU code examples for the TM1638 chip.

Hossein-M98 commented 1 year ago

Hello Thanks for contribution Unfortunately, this example will not work! There are some commented lines (lines 50~52) in the TM1638_platform.h file that should be uncommented, depending on the target platform. I suggest putting the platform-dependent parts of the code in the example's main.c file, as was done in the README.md. Good luck

hayschan commented 1 year ago

OK. I have an idea. I will add a commit later today.

  1. Add a MACRO that automatically activates when building with ESP-IDF build chain (using ESP_PLATFORM).
  2. Add a Kconfig for configuring the GPIO of TM1638.

I would like to make this TM1638 project as flexible as possible. So that most ESP users will not have to change the code. This is especially useful if they use this project as a git submodule.

Hossein-M98 commented 1 year ago

OK, continue, we will see the result

hayschan commented 1 year ago

Just pushed a new commit that did what I said.

The default GPIO pins for the ESP32 is still the same as your original pins, e.g. 0,1,2. Users can configure the GPIO pins to their custom pins through menuconfig (sdkconfig).

image

Currently, there are no errors building the ESP32 examples in ESP-IDF build chain.

I will test on a real TM1638 module and come back with the result of the digit displaying in real world.

hayschan commented 9 months ago

Any follow up that need to be done by me for this merge?

Hossein-M98 commented 9 months ago

You told me you were going to run tests with real hardware and report the result. I was waiting for your report. On the other hand, I changed the source code a little, first you need to apply the changes in your code.