Hey guys.
I'm trying to connect arduino mega to simulink, in order to transmit data from Arduino to Simulink. This is the code I'm using (very simple):
int ref1;
void setup() {
Serial.begin(9600);
}
void loop() {
ref1=20;
Serial.print(ref1);
}
As you can see, I use serial port to transmit data. I want to show the data ref1 in Simulink with a Display. The problem is I don't know which block should I use to receive the data from Arduino, I tried with "Serial receive" and "Packet output", but I always get a 0. What should I do?