All,
Apologies for cluttering up the board but I was able to find the solution to this. My next step is trying to combine set of inputs (doubles for 3 state variables) and send them across. For anyone else whom wanders across this, you don't want the arduino package simulink blocks. Instead use the Serial send and serial recieve blocks found in the "Instrument Control Toolbox". For the arduino uno you will set the serial configuration block to COM3.
I configured my system for a quick check as 9600 baud, 8 bits, no parity, 1 stop bit.
Here is some Arduino code that you can use to test the connection. Simulink model was a constant source -> data type conversion -> serial send block. Serial recieve -> data type conversion -> display block. The data type conversions are critical if you want anything useful. For the configuration mentioned above you will want to use uint8.
int incomingByte = 0;
//the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
pinMode(13, OUTPUT); // initialize digital pin 13 as an output
}
// the loop function runs repeatedly forever
void loop() {
//send data only when you recieve data
if(Serial.available() >0) {
incomingByte = Serial.read(); // read the incoming byte:
Serial.write(incomingByte*2); // modify and return the signal
digitalWrite(13, HIGH); //turn the LED on
delay(500); //wait a half second
digitalWrite(13, LOW); //turn the LED off
delay(1000); //wait a second
}
}