Hi, I'm trying to control the Arduino digital out from PureData. I'm using comport in PD to send serial data over the port and I need Arduino to read it and excecute a task. This seems like a realy simple thing to do, but I can't get it to work.
I'm using the Serial Read Advanced example included int the Arduino 003. The TX light turns on in the board when sending data over the port, but no luck with the
LED...
Any help would be very apreciated,
Thanks,
adrián goya
int ledPin = 13; // LED en el pin 13
int val = 0; //variabe para guardar el data del puerto serial
int serbyte = 0; //variable para guardar el data VALIDO del puerto
void setup()
{
pinMode(ledPin, OUTPUT);
beginSerial(19200);
}
void loop()
{
serbyte = serialRead();
if (val != -1) {
val = serbyte;
}
if (val == 113) {
digitalWrite(ledPin, LOW);
} else {
digitalWrite(ledPin, HIGH);
delay(1000);
}
}