On Wed, 2011-09-14 at 11:48 +0200, Ingo wrote:
Hi Roman,
thanks for taking the time looking at the code. Unfortunately your version will be sending even many more wrong numbers.
I have put some list messages into your patch. Keep clicking onto them randomly and you will see that the headers change between 6, 7, 14 and 15. Sometimes they are correct - sometimes not.
The problem is due to the change object inside the debyte object. Leaving it out would always send all 8 bits for the group of pins. Leaving it in will keep holding old values.
Gotcha. I removed the [change] objects from the [pd debytemask] subpatch. And I also agree, that it would be ugly, if digital pins fire without changing their state.
I cannot see any way other than using individual debyte objects for each group unless you would come up with something completely different like storing everything into an array and sending from there (after checking what has changed) which would be much more complicated.
Actually, I found the table based approach not that complicated and I think it is more scalable (it covers all possible 16 groups). I added a [pd polychange] subpatch that does exactly what you describe. I hopefully tested it more thoroughly this time. See attached patch.
Cheers Roman