I have been using a Freetronics 100% Arduino Compatible board to run switches that trigger sound file players in MaxMSP.

The only sketch and patch I could use to get the board and Max communicating was Arduino2Max. I am able to get 1's and 0's out of the board using the Arduino2Max patch to trigger the sound file players on and off but the signal is extremely ambiguous. When the switch is open it should be sending a 0, when it is closed a 1 but it is flickering between the two. It also can take up to 4 secs to switch back to a 0 to close the switch. When the sample rate is slowed it just means that the signal flickers at a slower rate.

I have tried using a prototyping board as well as plugging directly into the digital pins. Can someone please give me any advice? Could this be a signal issue to do with the quality of the wires I am using or could there be a problem with the board or the way the signal is converted through usb?


  • 3
    \$\begingroup\$ A schematic, code and/or scope plot would be useful to show us what's happening. \$\endgroup\$ – AngryEE Sep 13 '10 at 20:08
  • \$\begingroup\$ Do you have another Arduino board to try it with, so you can isolate the problem a little further? \$\endgroup\$ – user1307 Sep 14 '10 at 5:39

When my digital signals fluctuate when I expect them to be a constant 1 or 0, it's usually something about the pull-up resistors -- I haven't connected them properly, or they've somehow gotten disconnected.

Once I've ruled out that problem, my next most common problem is contact bounce. Jack Ganssle ran some experiments and has some debounce recommendations.

| improve this answer | |
  • \$\begingroup\$ Upvote for the Ganssle reference. The amount time he spent in his book on contact bounce was pretty amazing to me. I guess it is still something most people in industry do not think about. \$\endgroup\$ – Kortuk Sep 17 '10 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy