Arduino sensor?

Hi all,

I just started learning some Arduino and was wondering how to go about using something like a proximity sensor to control certain parameter values. Just something simple, like the closer you get to the sensor the more the image gets displaced.

Thanks.

Set your Arduino to “Serialprint” the numbers you need with a your favourite Baudrate.

Open Touchdesigner and use DAT Serial to receive the messages from the Arduino board through Serial communication (USB).

[Remember to turn off the serial monitor of Arduino]

Look the COM Port number and input it in the DATSerial parameters, set the Baudrate it has to be the same one you set on the Arduino IDE code (i usually go for 11520).

You should start to receive the messages that you might want to convert first in a table with DAT Convert, in paramenters split cells insert the character you want to be identified to split the cells, you can also insert the spacebar as character.

To convert these DAT numbers to CHOP channels, you can use a CHOP Dat to. Pay attention to the parameters of the CHOP Dat to on the bottom you have to set if the first column in names or values and if the first row is names or values.

If the signal of the distance sensor is not very stable, filter it with a CHOP Filter, set the effect to Half Gaussian for 0.1 sec should be enough.

have fun!
Nima

1 Like

Hi,

I’ve never used arduino with Td, but serial dat is what you need.
An other possible way (i would) is using a leonardo arduino like with an atmega32u4 wich acts as a midi usb device.
So in Td, you would use a native midi device. Plus it could be used with other softwares.