Piezo sensors and arduino in TouchDesigner

Hello, I have wired up three Piezo sensors and connected the data in touch, I am trying to use each sensor as a controller to show which visual is shown. So each sensor when touched should show a new visual on first contact, but then change when another sensor is touched. I have been trouble shooting this for ages and keep getting stuck on getting all three streams of data into one, to then control a switch between visuals.

ChatGPT keeps telling me to use a merge and analyse and logic after selecting each data stream, but it never works or it keeps being mistaken.

Any help would be greatly appreciated!

Hope this makes sense!

Is the problem that the data provided by the Arduino inconsistent or is it the touch network your having a problem with?

In the second case if i understand your question correctly this might help:
Input radio switch.1.toe (5.2 KB)

If this doesnt help best would be you provide a little example file that i can recreate to think of a solution

That input radio switch is basically exactly what I am trying to do, but with piezo sensor data, is there a way I can connect these into the buttons?
That was extremely helpful though, thank you, I will have a go and get back on this, if not I will attach an example file!

What kind of data is it you receive from the Arduino in Touchdesigner, can you post a screenshot maybe or post the entire toe file

The data is from piezo sensors so just from 0-2 at the moment, but usually 0-1025 I am assuming as the range never works in changing the data so I manually do it on the arduino code.

3 streams together.12.toe (6.3 KB)

Hopefully that project file works. I have followed the same steps as your previous radio file and got it all working, then trying to reference the chop values doesn’t seem to work, but then also trying to use the same system with the chop values and not buttons also doesn’t seem to work.

I am not sure the specific problem, but just getting this working has been a nightmare. I have a feeling it is to do with changing the range and the numbers not being specific to what I am trying to reference such as the button value.

I think the touch network is what I am having issues with, or finding the right solution to use this data as buttons so the physical sensors can be buttons, rather than clicking on the button.

Thanks so much for the help

Can you send a picture or video of the data in your network when it comes in?

I’ll take a look at it tomorrow

So your problem was that the Dat to Chop was set so the table sets the channel name, not the value.

second problem was the fan chop was set to fan out not fan in.

I wrote a little python in the Dat to chop so you can just copy it to add more sensors as long as you dont change the name of the Dat null or the dat to chop.

Hope this helps, and please let me know if it did

3 streams radio selector fixed.1.toe (4.7 KB)

Edit: make sure to connect the serial dat again, i used a table since i dont have a arduino running serial right now.
Chat GPT sometimes gives very complicated answers to easy tasks, best is to make a litte example file of the problem and upload it to GPT and tell it precicely what you need.
Then it works pretty good… sometimes

1 Like

Thank you so much, that did the trick and now works exactly how I wanted it to! Really appreciate it!

1 Like

Always happy to help☺️

Make sure to hit the solution flag so people with the same problem find the solution quicker