Pages: [1]   Go Down
Author Topic: unpack several serial data from arduino in max ?  (Read 738 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 
I have three analogin from arduino (three light sensors), and want to receive the serial data from them seperately.
 But now the max receives the data all in one, not seperately. (attached picture, plz watch red circle)
 What should I do between serial c 9600 object and unpakc opject in the picture attached ?
 
arduino code:I have three analogin from arduino (three light sensors), and want to receive the serial data from them seperately.
 But now the max receives the data all in one, not seperately. (attached picture, plz watch red circle)
 What should I do between serial c 9600 object and unpakc opject in the picture attached ?
 
arduino code:

void setup()
 {
 Serial.begin(9600);
 }
 
void loop()
 {
 int sensorValue = analogRead(A1);
 int sensorValue2 = analogRead(A2);
 int sensorValue3 = analogRead(A3);
 Serial.write(sensorValue);
 Serial.write(sensorValue2);
 Serial.write(sensorValue3);
 
}


* 11.jpg (208.96 KB, 816x612 - viewed 15 times.)

* 2.jpg (168.39 KB, 816x612 - viewed 11 times.)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48569
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
int sensorValue = analogRead(A1);
 int sensorValue2 = analogRead(A2);
 int sensorValue3 = analogRead(A3);
 Serial.write(sensorValue);
 Serial.write(sensorValue2);
 Serial.write(sensorValue3);
First, I'd suggest that you look at Serial.write()'s documentation, and see what type(s) is supports, and maybe look at the code to see what it does when you pass a different type to it.
Logged

Pages: [1]   Go Up
Jump to: