Message Boards Message Boards

Mathematica and Arduino device does not capture the serial stream under dynamic

I have set up the following sketch to capture a serial feed from an arduino. But the Dynamic command only pick up 4 feeds and dies. .

he Arduino sketch is

//*************************** // Credit original code to // Aleksandr Berezutskii //***************************

int raw1 = 0, raw2 = 0, raw3 = 0;
int x = 0, y1 = 0, y2 = 0, y3 = 0;
#define APin1 A11
#define APin2 A12
#define APin3 A13
void setup() 
{
Serial.begin(9600);
pinMode( APin1, INPUT );
pinMode( APin2, INPUT );
pinMode( APin3, INPUT );
analogReference(DEFAULT);
}

void loop() 
{
while (x<=6000)
{ 
raw1 = analogRead( APin1 );
y1=raw1;
raw2 = analogRead( APin2 );
y2=raw2;
raw3 = analogRead( APin3 );
y3=raw3;
x++;               
Serial.print( y1 );
Serial.print("\t"); 
Serial.print( y2 );
Serial.print("\t");                
Serial.print( y3 );
Serial.println();
delay(400);
}
}

The notepad is included here.

POSTED BY: Jose Calderon
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract