proximity sensor and light

    Mar 13 2013 | 5:06 pm
    hey guys, i am kinda new in using max msp and trying to figure something out. for a project i have a patch with different leds that can be turned on/off and bascially operated in max. btw these leds are connected to an arduino board and not the standard phidget interfacekit.
    now i wanted to connect those leds with a proximity sensor so they will automatically turn on once you approach the sensor within 80 cm.
    can someone help me how to figure out what to do. i tried to find patches on the internet for that kind of situation but there was nothing really that could help me ( at least that´s what i tought)
    i appreciate any comment. tx in advance.
    the patch is attached

    • Mar 13 2013 | 6:01 pm
      doesn't sound like you even need max for this.
      google "proximity sensor arduino code". Tons of readymade examples.
    • Mar 13 2013 | 7:12 pm
      since i already created a max patch it would be nice to stick to one format. also i can control the colour of the leds in the max patch now. besides that, i do not have lot´s of experience in coding... or is there a possibility to translate the arduino code into max?
      any suggestions?
    • Mar 13 2013 | 8:25 pm
      I would echo Wetterberg's suggestion to optimize this in Arduino first. Furthermore, it could be argued that, as programming environments, Max is way more complex where Arduino is more straightforward.
      You mention that you like being able to change LED colour; there's tutorials on how to do this quickly and simply on the Arduino site. Maybe you can define the interaction environment parameters a little more precisely for yourself - why, how and when LEDs react to proximity - before muddying the water with reading AND writing to Arduino via Max.
    • Mar 13 2013 | 11:06 pm
      true point, that´s something i still need to consider.
    • Mar 14 2013 | 9:29 am
      If I had more free time, I could suggest something simple in Arduino, but sadly under pressure at the moment. Search for terms like colour-changer, potentiometer, mood-light, LED, etc.
      I'm certainly no coding-ninja, but this should be v simple.
    • Mar 15 2013 | 4:29 pm
      tx again for your advice. i made the effort to code my stuff in arduino and it worked out perfectly! :)