Importing Data into a Spreadsheet

The data you collect with your sensors can be imported into a spreadsheet and displayed as a chart by saving your readings directly to disk in a format the spreadsheet software can interpret. For our purposes we want to save the data in text format with the time and sensor reading separated by a comma. Microsoft Excel will interpret the file as being a set of data made up of two fields. It will be able to import the readings, manipulate them and draw a chart (graph) based on the data.

Typical MSW Logo code to save readings from the Games Port is:

to fsave
; Saves data into 'comma delimited' format
; for importing into an Excel spreadsheet.
make "InValue ingameport 1
openappend "c:\\mswlogo\\test1.txt
setwrite "c:\\mswlogo\\test1.txt
print (se :count1 ", :InValue)
setwrite []
close "c:\\mswlogo\\test1.txt
end

;NOTE: The 'double backslashes' ARE needed.

to sense
make "count1 0 do.until [make "count1 :count1 + 5 fsave] [:count1 = 500]
end

<- Back -Menu- Next ->