I am working on my project and got stuck at sending variables from Matlab to Arduino.
What I want to do is to send this value from Matlab: 255,100,0,100,175,300
to fill 6 variables in Arduino so I can setup my PORTD properties. I want to generate signal like this on output:
I understand I can use Serial.parseint to fill my variables, but it is not really working, and since I'm really new to programming I don't know where I made a mistake. Can you PLEASE help me?
Arduino code looks like this:
if(Serial.available()>0) // if there is data to read
a=Serial.parseInt(); // read data
PORTD = a;
delay = b;
PORTD = c;
delay = d;
PORTD = e;
delay = f;