proximity sensor and light

Mar 13, 2013 at 5:06pm

proximity sensor and light

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

#67062
Mar 13, 2013 at 6:01pm

doesn’t sound like you even need max for this.

google “proximity sensor arduino code”. Tons of readymade examples.

#241352
Mar 13, 2013 at 7:12pm

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?

#241353
Mar 13, 2013 at 8:25pm

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.

Brendan.

#241354
Mar 13, 2013 at 11:06pm

true point, that´s something i still need to consider.

#241355
Mar 14, 2013 at 9:29am

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.

HTH

Brendan

#241356
Mar 15, 2013 at 4:29pm

tx again for your advice. i made the effort to code my stuff in arduino and it worked out perfectly! :)

#241357

You must be logged in to reply to this topic.