Hello,
I’m a beginner with arduino an Touchdedsigner, I just managed to make a Interface with Touchdesigner and there is a button, which should turn on/off the LED (connected with Arduino). Can someone tell me how I can do that?
Thanks
Heliya
Hello,
I’m a beginner with arduino an Touchdedsigner, I just managed to make a Interface with Touchdesigner and there is a button, which should turn on/off the LED (connected with Arduino). Can someone tell me how I can do that?
Thanks
Heliya
Hi Heliya, did you get a chance to look at this page?
derivative.ca/wiki/index.php?title=Arduino
I have not tried arduino with touch yet but will soon.
rod.
Hi rodberry,
I know how to read a analog or a digital signal with Arduino, with a Serial DAT but not how I can tell Arduino, that it have to switch on the LED. Serial is for ihe input and what is for the output?
Thank you all the same!
Heliya
As it says in the wiki page rodberry refers to: to output characters back to the Arduino, use the send Command. Bytes can be sent through the same Serial DAT.
Dear greg, can you make a little example, how the interface could look like?
Thanks
Heliya
Hello.
There are examples listed in this page:
derivative.ca/wiki077/index. … nd_Command
But it should be very simple:
send /project/serial1 “ABC” for example
(assuming the serial DAT is in /project1)
Let us know if that helps.
Feel free to post your sketch for more help
Cheers
-Rob
nothing happend… , I tried with his arduino code:
const int ledPin = 13; // the pin that the LED is attached to
int incomingByte; // a variable to read incoming serial data into
void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
}
void loop() {
// see if there’s incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it’s a capital H (ASCII 72), turn on the LED:
if (incomingByte == ‘H’) {
digitalWrite(ledPin, HIGH);
}
// if it’s an L (ASCII 76) turn off the LED:
if (incomingByte == ‘L’) {
digitalWrite(ledPin, LOW);
}
}
}
and Serial Skrip DAT: send -d /project1/serial1 72,
and nothing happend,
Hey Rob,
I have to say I don’t find the ABC or send(‘23 43 12’) examples particularly helpful as they are not really applicable to any real world use.
[code]But it should be very simple:
send /project/serial1 “ABC” for example[/code]
They prove a concept sure but it seems that to send a list of variables instead of a literal requires quite a bit more work (or at least knowledge of Python). A simple working example would be extremely useful (controlling one RGB led for instance).
Try some basic debugging:
Make sure your arduino is receiving serial commands:
if (Serial.available() > 0) {
incomingByte = Serial.read();
digitalWrite(ledPin, HIGH);
}
If this does nothing, it may be your serial connection isn’t quite working. Check that you’re using the correct port number (matching the port number mentioned in device manager). Perhaps test a with a processing sketch (there is an example in their lib too).
If you tested and it does work, then you might need to debug the ascii conversion.
If you’re using the “send -d” commands, make sure your script DAT is set to TScript mode (little “language” toggle icon in upper-right of parameter window), or if you stay in pyhton mode, just use op(‘/project/serial1’).sendBytes(72) or op(‘/project/serial1’).sendBytes(76)