Arduino data to touchdesigner

hey there,

i connected my arduino uno board with the HC-SR04 sensor and everything worked in arduino, the seriell monitor shows the numbers related to the movement… but when I connect it with touchdesigner the numbers that td receives are different and some are really random and really high. I checked the baud rate and all the settings but still something is wrong.

I thought maybe it has something to do with the different languages? for example when i connect arduino to p5 i have to do it with the p5serialcontrol to translate it to ASCII… is there something like this for touchdesigner?

greetings xx

(i just started so sorry if its not super clear)

Do you have a screen shot of the data TouchDesigner is receiving?

here you can see, its basically the right number but it puts it a couple of time in one line …

This could be a few different things. I would play around with the parameter called “Row/Callback Format” As this is how it decides to split up rows.

In your arduino code are you writing “Serial.println()” or “Serial.print()” ??

the “println” adds a line-ending to each message. this could be a better way to splitting up the values when they get to touch

You may also want to slow down the Arduino process. TD will only move as fast as you set it, so additional data won’t really be used. You can add a counter that adds in your loop() function, when it gets to 10 (or whatever) reset the counter and send one message over serial. This would effectively be 1/10th the transmission speed.

You may also want to experiment with the serial CHOP instead as it is designed to take in numerical values a bit better.