Iam working on a RGB Led Project using the TLC5940s.
So I've got my first TLC up an runing put I'am quite confused with it.
I use the library from the Cookbook.
My question:
Is it possible to get the send routine out of the main loop? (Something like a timer that automatically sends the data so the main loop stays free)
PS: Sry for my bad english but i usually speak german. Iam from Austria.
Hey guys!!
Iam working on a RGB Led Project using the TLC5940s.
So I've got my first TLC up an runing put I'am quite confused with it.
I use the library from the Cookbook.
My question:
Is it possible to get the send routine out of the main loop? (Something like a timer that automatically sends the data so the main loop stays free)
PS: Sry for my bad english but i usually speak german. Iam from Austria.
There's a good reason for putting as much as possible into the main loop (or function ultimately called from the main loop). Please have a read of this to understand why.
It is possible to just create a timer and in it's callback function and place the send routine in there. But read the above article first before starting to plonk lots of code in callbacks just to "keep the main loop clean". The main loop is your workhorse. Keep it clean by only calling out to other functions rather than leave it empty.
There's a good reason for putting as much as possible into the main loop (or function ultimately called from the main loop). Please [[/users/AjK/notebook/regarding-interrupts-use-and-blocking/|have a read of this]] to understand why.
It is possible to just create a timer and in it's callback function and place the send routine in there. But read the above article first before starting to plonk lots of code in callbacks just to "keep the main loop clean". The main loop is your workhorse. Keep it clean by only calling out to other functions rather than leave it empty.
Oh, and I should have said, if you want a "nice tidy" main loop, don't need any advanced RTOS you could always look at SimpleScheduler which I like to use as a simple "cable tidy" for functions :)
Oh, and I should have said, if you want a "nice tidy" main loop, don't need any advanced RTOS you could always look at SimpleScheduler which I like to use as a simple "cable tidy" for functions :)
<<library /users/AjK/libraries/SimpleScheduler/latest>>
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
Hey guys!!
Iam working on a RGB Led Project using the TLC5940s.
So I've got my first TLC up an runing put I'am quite confused with it. I use the library from the Cookbook.
My question:
Is it possible to get the send routine out of the main loop? (Something like a timer that automatically sends the data so the main loop stays free)
PS: Sry for my bad english but i usually speak german. Iam from Austria.