@SGian.1 wrote:
I still work on my project for read Ibutton.
This one: https://community.st.com/t5/others-hardware-and-software/dallas-ibutton-and-uart/td-p/755993 ?
@SGian.1 wrote:
unfortunately i can’t use interrupt
Why not?
@SGian.1 wrote:
Now i want use a W2812B for report some error.
You mean those "smart" RGB LEDs with the single wire interface - known by some as "NeoPixels", etc?
Note that you can apply a similar technique to synthesise the drive for these using, eg, SPI.
There are also version available which work directly on SPI; eg, SK9822 or APA102C:
https://learn.sparkfun.com/tutorials/apa102-addressable-led-hookup-guide/all
https://www.pololu.com/product/3089 (I think AdaFuit call these "DotStar"?)
@SGian.1 wrote:
Soo my question is how I can implement one function work in back ground for example turn on and off led every second without give a error with function check the presence of the key ?
You said you're polling, so you have full control of the timing of these things.
Just sequence your LED drive and your 1-WireTM access so that they don't interfere with each other!
If you're polling the 1-WireTM every 500ms, and updating the LEDs every second, then you just need to do the LED update with every other transaction 1-WireTM;
eg, have a 500ms "tick", and do the LED update on the odd ticks
if( tick_count & 1 )
{
// The tick count is odd
update_LEDs();
}
do_1wire();
tick_count++;
PS:
More on driving these "smart" LEDs:
https://community.st.com/t5/stm32-mcus-products/problems-controlling-sk6812rgbw-neopixel-with-stm32h7/td-p/766560