Forums > MaxMSP

How to convert frequent bang into zero or one?

February 8, 2013 | 8:49 pm

Hi!
I am sending some data via the serial object from an Arduino to the Computer e.g an "A".
All I want is as long an "A" is recieved a toggle box is set and vice versa. The problem is that I read out data from the serial object every 50ms (via qmetro) and this means that the output changes with that frequency, but I want a "solid state" like "A received or not.

How can I manage that?

– Pasted Max Patch, click to expand. –

February 8, 2013 | 10:43 pm

Hi

[onebang]?

Brendan


February 8, 2013 | 10:50 pm

maybe instead of using [sel 65], use [== 65] ->[change]->[toggle], so it stays on 1 rather continual bangs causing the toggle to alternate between 1 and zero


February 8, 2013 | 11:00 pm

So when is it considered "Not A?"

– Pasted Max Patch, click to expand. –

February 8, 2013 | 11:19 pm

introduces latency of course

– Pasted Max Patch, click to expand. –

February 9, 2013 | 12:17 pm

Terry! Thank you, the latency solution works great.

Yours

Brantiko


Viewing 6 posts - 1 through 6 (of 6 total)