Quantcast
Channel: SolderCore » CoreLight
Viewing all articles
Browse latest Browse all 3

Data Logging – Part 1

$
0
0

The video above, demonstrates, how data from an external sensor (or two) can be logged to the uSD card on the SolderCore board. The data captured can then be transferred to the PC for viewing or post analysis. In the second part of this blog, data is logged to an online service so you can view the data captured by the SolderCore using a web browser.

Code from the video

   10 'Code for the part 1 of the data logging blog.
   20 'Simple data logging to the on board uSD card
   30 '
   40 INSTALL "core-light" AS CL
   50 INSTALL "SolderCore-Sensecore" AS SC
   60 INSTALL "TC77" USING SC.A AS TS
   70 '
   80 '
   90 FOR I = 0 TO 9
  100   '
  110   AT = TS.TEMP
  120   AL = CL.LIGHT
  130   '
  140   PRINT "Temp = " + STR(AT)
  150   PRINT "Lux = " + STR(AL)
  160   '
  170   '
  180   CALL LOGUSD(TIME$, STR(AL), ST(AT)
  190 NEXT I
  200 '
  210 END
  220 ' log data to the uSD card
  230 DEFPROC LOGUSD(MYTIME, MYVAL1, MYVAL2)
  240   'write data to usd Card
  250   F = OPEN("/c/log.csv", READ WRITE)
  260   IF F < 0 THEN
  270     PRINT "Failed to open file."
  280     RETURN
  290   ENDIF
  300   PTR F = EXT F ' Set file ptr to the end of the file.
  310   'PRINT MYTIME + MYVAL1 + "," + MYVAL2
  320   PRINT #F, MYTIME + "," + MYVAL1 + "," + MYVAL2
  330   CLOSE F
  340 ENDPROC
  

 


Viewing all articles
Browse latest Browse all 3

Trending Articles