Hi Ingo

Thanks for all your reports.

Sorry that my replies sometimes only come a few days later. I'm still
willing to fix any outstanding issues, but not very often I find time to
get an arduino into my hands. Since sometimes I have troubles following
you and keeping your several bug reports apart from each other, I'd
suggest to stick with [arduino] bugs and let the documentation aspect
aside for a while. 

I _think_ I finally understand your problem with the digital ins. I
can't currently test or reproduce the problem, since I don't have an
arduino at hand, but from reading the code, I think I see what could go
wrong.

On certain incoming commands of [pd digital messages], the [pd
debytemask] *) subpatch generates more than one message, but only the
last one is finally sent to the outlet, because it only fires, when the
left inlet of [+ ] is triggered, which is under all circumstances only
triggered once after all the [pd debytemask] messages have fired.
Actually, the order should be inversed, so that all messages from [pd
debytemask] go the _left_ inlet of [+ ], and the summand is sent the
_right_ inlet before.  This is what I did in the patch you find
attached. 

I rather have my version going into [arduino], since it is much less
code than yours. From what I can tell, they both produce similar output,
but as I said, I haven't had the chance to test it in real-world
circumstances with a real arduino. So, please test and report back.

I guess the main reason nobody (including me) has noticed this bug yet,
is that you won't trigger it, if you only test one digital in at once.
Changing the state of only one input at a time makes it seem, that all
inputs work correctly. Only when changing states of several inputs at
the same time, you will receive only a single digital messages, which is
obviously wrong.

I'm happy now that you kept bugging about this. It took me a while to
(hopefully) understand the problem. Thanks for your persistence.

*) There is no [debytemask] abstraction anymore in the git version of
[arduino]. I replaced it by a subpatch.

Roman


On Sun, 2011-09-11 at 06:20 +0200, Ingo wrote:
> There is another thing that I just noticed about the pduino test-patch.
> 
> The mode buttons are suggesting that you can turn of all functions by
> selecting "NONE". This is not true! These buttons have absolutely NO
> function and should be replaced with the correct commands.
> While doing this the option "Input-PullUp" should be added.
> 
> The Arduino generally defaults to input. Selecting "NONE" at the current
> state leaves it at the last selected option.
> 
> The analogue ins can actually be turned off by the command "analogIns X 0"
> (where the X stands for the pin number 0-5). The digital input pins need the
> command "digitalIns X 0" (where the X stands for the pin number 0-11).
> 
> I also think that there should be a separate block for digital an analogue
> (with the available options only) as beginners might think you could select
> "analog" as an option for digital pins, and so on...
> 
> Ingo
> 
> 
> BTW with the fix I just submitted in my last email all digital ins now work
> flawlessly after testing for several hours. I am amazed that hardly anybody
> noticed is bug for over two years!
> 


#N canvas 490 1631 331 170 10;
#N canvas 571 1511 538 392 digital 0;
#X obj 58 3 inlet;
#X obj 58 286 outlet;
#X msg 58 113 0 \$1;
#X msg 96 113 1 \$1;
#X msg 134 113 2 \$1;
#X msg 172 113 3 \$1;
#X msg 210 113 4 \$1;
#X msg 248 113 5 \$1;
#X msg 286 113 6 \$1;
#X msg 328 113 7 \$1;
#X obj 58 208 +;
#X obj 394 106 & 15;
#X msg 58 261 digital \$1 \$2;
#X obj 394 127 * 8;
#X obj 58 230 pack float float;
#X obj 58 163 unpack float float;
#N canvas 0 69 450 300 debytemask 0;
#X obj 32 140 & 1;
#X obj 82 139 & 2;
#X obj 132 139 & 4;
#X obj 182 139 & 8;
#X obj 232 139 & 16;
#X obj 282 139 & 32;
#X obj 332 139 & 64;
#X obj 382 139 & 128;
#X obj 32 220 outlet;
#X obj 82 220 outlet;
#X obj 132 220 outlet;
#X obj 182 220 outlet;
#X obj 232 220 outlet;
#X obj 282 220 outlet;
#X obj 332 220 outlet;
#X obj 382 220 outlet;
#X obj 32 76 trigger float float float float float float float float
;
#X obj 32 32 inlet;
#X obj 82 160 >> 1;
#X obj 132 160 >> 2;
#X obj 182 160 >> 3;
#X obj 232 160 >> 4;
#X obj 282 160 >> 5;
#X obj 332 160 >> 6;
#X obj 382 160 >> 7;
#X obj 32 186 change;
#X obj 82 187 change;
#X obj 132 187 change;
#X obj 182 187 change;
#X obj 232 188 change;
#X obj 282 189 change;
#X obj 332 189 change;
#X obj 382 189 change;
#X connect 0 0 25 0;
#X connect 1 0 18 0;
#X connect 2 0 19 0;
#X connect 3 0 20 0;
#X connect 4 0 21 0;
#X connect 5 0 22 0;
#X connect 6 0 23 0;
#X connect 7 0 24 0;
#X connect 16 0 0 0;
#X connect 16 1 1 0;
#X connect 16 2 2 0;
#X connect 16 3 3 0;
#X connect 16 4 4 0;
#X connect 16 5 5 0;
#X connect 16 6 6 0;
#X connect 16 7 7 0;
#X connect 17 0 16 0;
#X connect 18 0 26 0;
#X connect 19 0 27 0;
#X connect 20 0 28 0;
#X connect 21 0 29 0;
#X connect 22 0 30 0;
#X connect 23 0 31 0;
#X connect 24 0 32 0;
#X connect 25 0 8 0;
#X connect 26 0 9 0;
#X connect 27 0 10 0;
#X connect 28 0 11 0;
#X connect 29 0 12 0;
#X connect 30 0 13 0;
#X connect 31 0 14 0;
#X connect 32 0 15 0;
#X restore 58 78 pd debytemask;
#X obj 58 24 t a a;
#X msg 85 46 \$1;
#X msg 58 46 \$2;
#X connect 0 0 17 0;
#X connect 2 0 15 0;
#X connect 3 0 15 0;
#X connect 4 0 15 0;
#X connect 5 0 15 0;
#X connect 6 0 15 0;
#X connect 7 0 15 0;
#X connect 8 0 15 0;
#X connect 9 0 15 0;
#X connect 10 0 14 0;
#X connect 11 0 13 0;
#X connect 12 0 1 0;
#X connect 13 0 10 1;
#X connect 14 0 12 0;
#X connect 15 0 10 0;
#X connect 15 1 14 1;
#X connect 16 0 2 0;
#X connect 16 1 3 0;
#X connect 16 2 4 0;
#X connect 16 3 5 0;
#X connect 16 4 6 0;
#X connect 16 5 7 0;
#X connect 16 6 8 0;
#X connect 16 7 9 0;
#X connect 17 0 19 0;
#X connect 17 1 18 0;
#X connect 18 0 11 0;
#X connect 19 0 16 0;
#X restore 21 21 pd digital messages roman;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to