Commits

iorodeo committed d9c525c

Modified separator characters.

Comments (0)

Files changed (3)

firmware/accel_adxl345/accel_adxl345.pde

 
     while (buffer.getSize() > 0) {
         raw = buffer.getVal();
-        Serial << raw.XAxis << "," << raw.YAxis << "," << raw.ZAxis;
+        Serial << raw.XAxis << " " << raw.YAxis << " " << raw.ZAxis;
         cnt++;
         if (cnt < maxSendCnt) {
-            Serial << ";";
+            Serial << ":";
         }
         else {
             Serial << endl;

matlab/src/AccelADXL345.m

            data = zeros(n,3);
            done = false;
            cnt = 1;
-           
            while ~done
                out = fscanf(self.ser);
                out = strtrim(out);
-               out = strsplit(out,';');
+               out = strsplit(out,':');
                for i = 1:length(out)
                   line = out{i};
                   line = str2array(line);
 % Converts an input string of numbers separated by commas into to an array.
 
 line = strtrim(line);
-line = strsplit(line,',');
+line = strsplit(line,' ');
 array = zeros(size(line));
 
 % Convert elements to doubles

python/accel_adxl345/accel_adxl345.py

         Read a single float of list of floats separated by commas
         """
         value = self.readValue()
-        if ',' in value:
-            value = value.split(',')
+        if ' ' in value:
+            value = value.split(' ')
             value = [float(x) for x in value]
         else:
             value = float(value)
         Read a single integer or list of integers separated by commas.
         """
         value = self.readValue()
-        if ',' in value:
-            value = value.split(',')
+        if ' ' in value:
+            value = value.split(' ')
             value = [int(x) for x in value]
         else:
             value = int(value)
         if self.inWaiting() > 0:
             line = self.readline()
             line = line.strip()
-            line = line.split(';')
+            line = line.split(':')
             for vals in line:
-                vals = vals.split(',')
+                vals = vals.split(' ')
                 try:
                     vals = [float(x) for x in vals]
                     if len(vals) == 3:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.