Ping sensor and Datalogger
I have the datalogger and the ping sensor hooked up, and I'm using the datalogger program. It takes measurements from the ping sensor and stores them, and then displays them. The program stores them fine, but when it displays them, it just displays the last one over and over.
Example:
Memory Stick Datalogger Demo V1.0
Initializing...Done!
Synchronizing...Done
Switching to Short Command Mode...Done!
Waiting for Memory Stick...Ready!
Opening Data File...Open!
Writing Data...
Sample 00001 of 00010 --> 00076
Sample 00002 of 00010 --> 00076
Sample 00003 of 00010 --> 00077
Sample 00004 of 00010 --> 00041
Sample 00005 of 00010 --> 00012
Sample 00006 of 00010 --> 00052
Sample 00007 of 00010 --> 00014
Sample 00008 of 00010 --> 00038
Sample 00009 of 00010 --> 00014
Sample 00010 of 00010 --> 00051
Closing Data File...Done!
Opening Data File...Open!
Reading Data...
Sample 00001 of 00010 --> 00051
Sample 00002 of 00010 --> 00051
Sample 00003 of 00010 --> 00051
Sample 00004 of 00010 --> 00051
Sample 00005 of 00010 --> 00051
Sample 00006 of 00010 --> 00051
Sample 00007 of 00010 --> 00051
Sample 00008 of 00010 --> 00051
Sample 00009 of 00010 --> 00051
Sample 00010 of 00010 --> 00051
Closing Data File...Program Complete!
Here's the code.
datalogger demo.bs2
Example:
Memory Stick Datalogger Demo V1.0
Initializing...Done!
Synchronizing...Done
Switching to Short Command Mode...Done!
Waiting for Memory Stick...Ready!
Opening Data File...Open!
Writing Data...
Sample 00001 of 00010 --> 00076
Sample 00002 of 00010 --> 00076
Sample 00003 of 00010 --> 00077
Sample 00004 of 00010 --> 00041
Sample 00005 of 00010 --> 00012
Sample 00006 of 00010 --> 00052
Sample 00007 of 00010 --> 00014
Sample 00008 of 00010 --> 00038
Sample 00009 of 00010 --> 00014
Sample 00010 of 00010 --> 00051
Closing Data File...Done!
Opening Data File...Open!
Reading Data...
Sample 00001 of 00010 --> 00051
Sample 00002 of 00010 --> 00051
Sample 00003 of 00010 --> 00051
Sample 00004 of 00010 --> 00051
Sample 00005 of 00010 --> 00051
Sample 00006 of 00010 --> 00051
Sample 00007 of 00010 --> 00051
Sample 00008 of 00010 --> 00051
Sample 00009 of 00010 --> 00051
Sample 00010 of 00010 --> 00051
Closing Data File...Program Complete!
Here's the code.
datalogger demo.bs2

Comments
1) Why did you comment this out of the code?
2) I understand why you did this. But, did you remove any other code above or below this?
What, I would do is connect the demo circuit up has shown at top of the program code and change to this to see if it takes of your problem.
The program was originally for a light sensor or thermistor, but since I didn't have one of those, I had to change it to accept the ping data. All I changed was where it gathered the data, and replaced result with cmDistance.
I got the program working (I had forgotten to replace the result variable in a few places) and I uncovered a new problem. The first measurement it displays on opening the file seems to be a number around the maximum measurement. Then it just moves the rest of the measurements down one space, and never displays the original sample 10.
example:
Memory Stick Datalogger Demo V1.0
Initializing...Done!
Synchronizing...Done
Switching to Short Command Mode...Done!
Waiting for Memory Stick...Ready!
Opening Data File...Open!
Writing Data...
Sample 00001 of 00010 --> 00075
Sample 00002 of 00010 --> 00075
Sample 00003 of 00010 --> 00075
Sample 00004 of 00010 --> 00038
Sample 00005 of 00010 --> 00040
Sample 00006 of 00010 --> 00037
Sample 00007 of 00010 --> 00035
Sample 00008 of 00010 --> 00036
Sample 00009 of 00010 --> 00075
Sample 00010 of 00010 --> 00042
Closing Data File...Done!
Opening Data File...Open!
Reading Data...
Sample 00001 of 00010 --> 00079
Sample 00002 of 00010 --> 00075
Sample 00003 of 00010 --> 00075
Sample 00004 of 00010 --> 00075
Sample 00005 of 00010 --> 00038
Sample 00006 of 00010 --> 00040
Sample 00007 of 00010 --> 00037
Sample 00008 of 00010 --> 00035
Sample 00009 of 00010 --> 00036
Sample 00010 of 00010 --> 00075
Closing Data File...Program Complete!
' Smart Sensors and Applications - PingMeasureCmAndIn.bs2 ' Measure distance with Ping))) sensor and display in both in & cm ' {$STAMP BS2} ' {$PBASIC 2.5} ' Conversion constants for room temperature measurements. CmConstant CON 2260 InConstant CON 890 cmDistance VAR Word inDistance VAR Word time VAR Word DO PULSOUT 15, 5 PULSIN 15, 1, time cmDistance = cmConstant ** time inDistance = inConstant ** time DEBUG HOME, DEC3 cmDistance, " cm" DEBUG CR, DEC3 inDistance, " in" PAUSE 100 LOOPFrom, what I see in the above test code, you will need to comment this back into your code to get your program working the way you want it too.I think it will provide you with better results if you tried it.