asergunov / 7segment_gpio

7-digits GPIO display platform for esphome
MIT License
2 stars 0 forks source link

Max digit count locked at 4 + esp8266 support #12

Open einarav opened 1 month ago

einarav commented 1 month ago

from 7segment_gpio.h line 33: constexpr uint8_t max_digit_count = 4; Cannot initialize more digits because of this limit.

I also tried using this with esp8266 and that did not work, are you planning to implement support for that?

asergunov commented 1 month ago

Hello. The hardcoded limit looks one char fix. You more than welcome to open pull request.

For the esp8266 the problem I guess is the way timer interrupt setup. I'll be happy if you have a look.

asergunov commented 1 month ago

Just curious did you figure out pins to use for display on esp8266?

Gives me 9 pins so 2 digits without dot or one digit with dot max.

Also we should figure out connection which will let it boot.

I'll be happy if you share your experience.

einarav commented 1 month ago

I am using a couple of SN74HC595 shift registers connected to my displays! Hot fixing the char limit on my library clone allows me to set the pins:

I still need to figure out the interrupt routine to get anything usefull displayed on the displays, I will share whenever I get closer to resolving this!

asergunov commented 1 month ago

That's great! Checked their code of sn74hc595 component

It performs write operation whenever single pin changed. But for display it will be nice ti change all at once:

I guess you'll need to update also sn74hc595 component to change 'outputbytes' all at once.

Or just a flag disabling gopio_write calls so you can set all the bits in state you like and write them all at once when done.