PDA

View Full Version : trouble writing data, bs2pe...please help



kuenyls
02-25-2010, 10:26 AM
··I am·writing data from an accelerometer into eeprom. I am·able to display the accelerometer data as I record the data. After writing the code and reading it to display the two values do not match. I am able to match the sign value with a 0 or 1. The first whole number value matches but the decimals do not. Can you tell me why.. Here is a copy of the complete code and the corresponding output data.

·················································· ······························ ' -----[ Title ]--------------------------------------------------------------
' Smart Sensors and Applications - DatalogAcceleration.bs2
' Datalogs 500 x and y-axis acceleration measurements.
'{$STAMP BS2pe}
'{$PBASIC 2.5}
' -----[ DATA Directives ]----------------------------------------------------
Reset········· DATA··· 0
Records······· DATA··· (500)
RecordsEnd···· DATA
' -----[ I/O Definitions ]-------------------------------------------------
Xin············ PIN···· 8······················ ' X input from Memsic 2125
Yin············ PIN···· 9······················ ' Y input from Memsic 2125
' -----[ Constants ]-------------------------------------------------------
' Set scale factor for PULSIN
#SELECT $STAMP
· #CASE BS2PE
··· Scale······ CON···· $1E1··················· ' 1.88 us per unit
#ENDSELECT
HiPulse········ CON···· 1······················ ' measure high-going pulse
LoPulse········ CON···· 0
DegSym········· CON···· 176···················· ' degrees symbol
' -----[ Variables ]----------------------------------------------------------
char·········· VAR···· Byte
eeIndex······· VAR···· Word
value········· VAR···· Word
'x············· VAR···· value
'y············· VAR···· Word
xRaw··········· VAR···· Word··················· ' pulse from Memsic 2125
xmG············ VAR···· Word··················· ' g force (1000ths)
xmG1············ VAR···· Word··················· ' g force (1000ths)
'xTilt·········· VAR···· Word··················· ' tilt angle
yRaw··········· VAR···· Word
ymG············ VAR···· Word
ymG1············ VAR···· Word
xmG2············ VAR···· Word
xmG3············ VAR···· Word
ymG2············ VAR···· Word
ymG3············ VAR···· Word
··· ' g force (1000ths)
'yTilt·········· VAR···· Word
disp··········· VAR···· Byte··················· ' displacement (0.0 - 0.99)
'angle·········· VAR···· Byte··················· ' tilt angle

' -----[ Initialization ]-----------------------------------------------------
Init:
READ Reset, value
value = value + 1
WRITE Reset, value
IF value // 2 = 0 THEN
· FOR char = 10 TO 0
··· DEBUG CLS, "Datalogging starts", CR,
·············· "in ", DEC2 char, " seconds",
·············· CR, CR,
·············· "Press/release Reset", CR,
·············· "for menu..."
··· PAUSE 950
· NEXT

· GOSUB Record_Data

ENDIF

' -----[ Main Routine ]-------------------------------------------------------
DO
· DEBUG CLS,
······· "Press/Release Reset", CR,
······· "to arm datalogger ", CR, CR,
······· " - or - ", CR, CR,
······· "Type C, R or W", CR,
······· "C - Clear records", CR,
······· "R - Record records", CR,
······· "W - Display records", CR,
······· ">"
· DEBUGIN char
· DEBUG CR
· SELECT char
··· CASE "C", "c"
····· GOSUB Clear_Data
··· CASE "R", "r"
····· GOSUB Record_Data
··· CASE "W", "w"
····· GOSUB Display_Data
··· CASE ELSE
····· DEBUG CR, "Not a valid entry.",
··········· CR, "Try again."
····· PAUSE 1500
· ENDSELECT
LOOP
' -----[ Subroutine - Clear_Data ]--------------------------------------------
Clear_Data:
· DEBUG CR, "Clearing..."
· FOR eeIndex = Records TO RecordsEnd
··· WRITE eeIndex, 0
· NEXT
· DEBUG CR, "Records cleared."
· PAUSE 1000
· RETURN
' -----[ Subroutine - Record_Data ]-------------------------------------------
Record_Data:

· PAUSE 200
· DEBUG CLS, "Recording..."
· FOR eeIndex = Records TO RecordsEnd STEP 6
··· PULSIN Xin, HiPulse, xRaw···················· ' read pulse output
····· xRaw = xRaw */ Scale························· ' convert to uSecs
····· xmG = ((xRaw / 10) - 500) * 8················ ' calc 1/1000 g


··· PULSIN Yin, HiPulse, yRaw
····· yRaw = yRaw */ Scale
····· ymG = ((yRaw / 10) - 500) * 8
····· DEBUG DEC eeIndex, CRSRX, 7, (xmG.BIT15 * 13 + " "),
········· DEC (ABS xmG / 1000), ".", DEC3 (ABS xmG), " gs", CRSRX, 14, (ymG.BIT15 * 13 + " "),
········· DEC (ABS ymG / 1000), ".", DEC3 (ABS ymG), " gs", CR

··· WRITE eeIndex,Word (xmG.BIT15)
··· WRITE eeIndex +1, Word (ABS xmG / 1000)
··· WRITE eeIndex +2, Word (ABS xmG)
··· WRITE eeIndex +3 , Word (ymG.BIT15)
··· WRITE eeIndex +4, Word (ABS ymG / 1000)
··· WRITE eeIndex +5, Word (ABS ymG)
· NEXT

· PAUSE 950
· DEBUG CR, "End of records.",
······· CR, "Press Enter for menu..."
· DEBUGIN char
· RETURN
' -----[ Subroutine - Display_Data ]------------------------------------------
Display_Data:
· DEBUG CR, "Index· x-axis· y-axis",
······· CR, "-----· ------· ------",
······· CR
·· eeIndex = 0
· FOR eeIndex = Records TO RecordsEnd STEP 6

·READ eeIndex,· xmG1
· READ eeIndex +1 , xmG2
· READ eeIndex +2, xmG3
·READ eeIndex +3, ymG1
· READ eeIndex +4, ymG2
· READ eeIndex +5, ymG3
··· 'DEBUG DEC eeIndex, CRSRX, 7, (xmG1 + " "),
······· '· DEC (xmG2), ".", DEC3 (xmG3), " g", CRSRX, 14, (ymG1 + " "),
········ 'DEC (ymG2), ".", DEC3 (ymG3), " g", CR
··· DEBUG DEC eeIndex, CRSRX, 7,·· DEC (xmG1), " ", DEC1 (xmG2),".", DEC1 xmG3,
···· " g·· " , CRSRX, 14, DEC ymG1, " ", DEC1 (ymG2), ".", DEC1 (ymG3), "g", CR
· NEXT
· DEBUG CR, "Press Enter for menu..."
· DEBUGIN char
· RETURN

'Get_Gforce:
·' DO
· '· PAUSE 25··························· ' small loop pad
·· ' OWIN 6, 4, [Xin]··················· ' check status (bit transfer)
·' LOOP UNTIL (Xin)····················· ' 1 when complete
· 'OWOUT 6, 1, ["b", 1, SDEC4 xmG]··············· ' read DS1822 scratchpad
· 'OWIN· 6, 2, [Xin, Yin]··············· ' get raw temp data
· 'RETURN




Here is the output from the debug window.

Recordi-0.280 -0.288 gs
7····· -0.280 -0.288 gs
13···· -0.280 -0.288 gs
19···· -0.280 -0.296 gs
25···· -0.280 -0.296 gs
31···· -0.280 -0.304 gs
37···· -0.464· 0.136 gs
43···· -0.792· 0.000 gs
49····· 1.776 -2.008 gs
55···· -3.200· 1.560 gs
61···· -1.120 -0.184 gs
67····· 1.424 -2.888 gs
73···· -2.200 -0.016 gs
79···· -1.432· 0.536 gs
85····· 2.496 -3.480 gs
91···· -2.488 -0.912 gs
97···· -1.472· 0.920 gs
103···· 2.280 -2.664 gs
109··· -3.920· 1.360 gs
115···· 2.960 -2.568 gs
121··· -3.584· 1.016 gs
127···· 1.480 -3.728 gs
133··· -2.936 -0.048 gs
139··· -1.312· 0.640 gs
145···· 2.232 -2.144 gs
151··· -4.000· 1.112 gs
157··· -0.080 -2.736 gs
163··· -1.000 -0.144 gs
169··· -1.520· 0.616 gs
175···· 1.304 -1.320 gs
181··· -3.792· 1.912 gs
187···· 0.768 -2.528 gs
193··· -3.688· 1.600 gs
199···· 2.168 -2.904 gs
205··· -3.792· 1.048 gs
211···· 1.344 -3.040 gs
217··· -3.752· 1.176 gs
223···· 3.416 -3.312 gs
229··· -3.696 -0.128 gs
235···· 2.592 -4.000 gs
241··· -3.600· 0.712 gs
247···· 3.416 -3.936 gs
253··· -3.576· 1.904 gs
259···· 1.800 -3.896 gs
Press/Release Reset
to arm datalogger
·- or -
Type C, R or W
C - Clear records
R - Record records
W - Display records
>w
Index· x-axis· y-axis
-----· ------· ------
1····· 1 0.4 g1 0.2g
7····· 1 0.4 g1 0.2g
13···· 1 0.4 g1 0.2g
19···· 1 0.4 g1 0.0g
25···· 1 0.4 g1 0.0g
31···· 1 0.4 g1 0.8g
37···· 1 0.8 g0 0.6g
43···· 1 0.4 g0 0.0g
49···· 0 1.0 g1 2.6g
55···· 1 3.8 g0 1.4g
61···· 1 1.6 g1 0.4g
67···· 0 1.4 g1 2.2g
73···· 1 2.2 g1 0.6g
79···· 1 1.2 g0 0.4g
85···· 0 2.2 g1 3.2g
91···· 1 2.4 g1 0.4g
97···· 1 1.2 g0 0.2g
103··· 0 2.2 g1 2.4g
109··· 1 3.0 g0 1.0g
115··· 0 2.4 g1 2.8g
121··· 1 3.0 g0 1.8g
127··· 0 1.0 g1 3.4g
133··· 1 2.0 g1 0.8g
139··· 1 1.2 g0 0.8g
145··· 0 2.4 g1 2.6g
151··· 1 4.0 g0 1.8g
157··· 1 0.0 g1 2.6g
163··· 1 1.2 g1 0.4g
169··· 1 1.0 g0 0.4g
175··· 0 1.4 g1 1.0g
181··· 1 3.8 g0 1.0g
187··· 0 0.0 g1 2.4g
193··· 1 3.4 g0 1.4g
199··· 0 2.0 g1 2.8g
205··· 1 3.8 g0 1.4g
211··· 0 1.4 g1 3.4g
217··· 1 3.8 g0 1.2g
223··· 0 3.8 g1 3.0g
229··· 1 3.2 g1 0.8g
235··· 0 2.2 g1 4.0g
241··· 1 3.6 g0 0.0g
247··· 0 3.8 g1 3.6g
253··· 1 3.8 g0 1.2g
259··· 0 1.8 g1 3.6g
265··· 1 4.0 g0 2.6g
271··· 0 2.0 g1 3.6g
277··· 1 3.2 g0 1.4g
283··· 0 2.6 g1 2.6g
289··· 1 3.6 g0 0.2g
295··· 1 0.0 g1 3.4g
301··· 1 3.2 g0 1.8g
307··· 0 2.6 g1 2.8g
313··· 1 2.8 g0 1.8g
319··· 1 0.0 g0 1.2g
325··· 0 0.6 g0 0.8g
331··· 0 0.0 g1 3.4g
337··· 1 3.4 g0 2.2g
343··· 1 0.2 g0 0.8g
349··· 1 0.4 g0 0.0g
355··· 1 0.6 g0 0.8g
361··· 1 0.6 g1 2.0g
367··· 1 1.0 g1 1.6g
373··· 0 0.4 g1 0.8g
379··· 1 0.0 g0 1.0g
385··· 1 0.2 g0 0.0g
391··· 1 0.4 g1 1.2g
397··· 1 2.2 g1 0.8g
403··· 1 0.0 g0 1.8g
409··· 1 0.6 g0 0.8g
415··· 1 0.6 g0 0.6g
421··· 1 0.2 g0 0.6g
427··· 1 0.0 g0 0.8g
433··· 0 0.2 g0 0.0g
439··· 1 0.4 g0 0.8g
445··· 1 0.2 g1 0.2g
451··· 0 0.6 g1 0.2g
457··· 1 0.0 g1 0.2g
463··· 1 0.8 g1 0.0g
469··· 1 0.8 g1 0.0g
475··· 1 0.0 g1 0.0g
481··· 1 0.8 g1 0.2g
487··· 1 0.8 g1 0.2g
493··· 1 0.8 g1 0.2g
499··· 1 0.8 g1 0.4g

While printing the debug after reading we have tried a number of combinations of DEC, DEC1, DEC2, DEC3 etc. None of these quite match.
·Thank you Thank you Thank you.·

All my love http://forums.parallax.com/images/smilies/freaked.gif· this is me pulling my hair out ......

·

Mike Green
02-25-2010, 01:47 PM
You're writing your data to the EEPROM incorrectly. Since you have 16 bit data already, why not write the values in 4 bytes by changing the "STEP 6" to "STEP 4" and changing the WRITEs to:

WRITE eeIndex, word xmG
WRITE eeIndex+2, word ymG

You'll have to change the READs as well to read two 16-bit values from 4 bytes and then break those apart for displaying.

kuenyls
02-26-2010, 04:10 AM
·Thats the first code I tried, but when I read back the data it maxes at .25g.· http://forums.parallax.com/images/smilies/sad.gif

' -----[ Title ]--------------------------------------------------------------
' Smart Sensors and Applications - DatalogAcceleration.bs2
' Datalogs 500 x and y-axis acceleration measurements.

'{$STAMP BS2pe}
'{$PBASIC 2.5}

' -----[ DATA Directives ]----------------------------------------------------

Reset········· DATA··· 0
Records······· DATA··· (500)
RecordsEnd···· DATA

' -----[ I/O Definitions ]-------------------------------------------------

Xin············ PIN···· 8······················ ' X input from Memsic 2125
Yin············ PIN···· 9······················ ' Y input from Memsic 2125

' -----[ Constants ]-------------------------------------------------------

' Set scale factor for PULSIN

#SELECT $STAMP
· #CASE BS2PE
··· Scale······ CON···· $1E1··················· ' 1.88 us per unit
#ENDSELECT

HiPulse········ CON···· 1······················ ' measure high-going pulse
LoPulse········ CON···· 0

DegSym········· CON···· 176···················· ' degrees symbol

' -----[ Variables ]----------------------------------------------------------

char·········· VAR···· Byte
eeIndex······· VAR···· Word
value········· VAR···· Word
'x············· VAR···· value
'y············· VAR···· Word

xRaw··········· VAR···· Word··················· ' pulse from Memsic 2125

xmG············ VAR···· Word··················· ' g force (1000ths)
xmG1············ VAR···· Word··················· ' g force (1000ths)
'xTilt·········· VAR···· Word··················· ' tilt angle

yRaw··········· VAR···· Word
ymG············ VAR···· Word
ymG1············ VAR···· Word··················· ' g force (1000ths)
'yTilt·········· VAR···· Word

disp··········· VAR···· Byte··················· ' displacement (0.0 - 0.99)
'angle·········· VAR···· Byte··················· ' tilt angle


' -----[ Initialization ]-----------------------------------------------------

Init:

READ Reset, value
value = value + 1
WRITE Reset, value

IF value // 2 = 0 THEN

· FOR char = 10 TO 0
··· DEBUG CLS, "Datalogging starts", CR,
·············· "in ", DEC2 char, " seconds",
·············· CR, CR,
·············· "Press/release Reset", CR,
·············· "for menu..."
··· PAUSE 950
· NEXT


· GOSUB Record_Data


ENDIF



' -----[ Main Routine ]-------------------------------------------------------

DO

· DEBUG CLS,
······· "Press/Release Reset", CR,
······· "to arm datalogger ", CR, CR,
······· " - or - ", CR, CR,
······· "Type C, R or W", CR,
······· "C - Clear records", CR,
······· "R - Record records", CR,
······· "W - Display records", CR,
······· ">"

· DEBUGIN char
· DEBUG CR

· SELECT char
··· CASE "C", "c"
····· GOSUB Clear_Data
··· CASE "R", "r"
····· GOSUB Record_Data
··· CASE "W", "w"
····· GOSUB Display_Data
··· CASE ELSE
····· DEBUG CR, "Not a valid entry.",
··········· CR, "Try again."
····· PAUSE 1500
· ENDSELECT

LOOP

' -----[ Subroutine - Clear_Data ]--------------------------------------------

Clear_Data:
· DEBUG CR, "Clearing..."
· FOR eeIndex = Records TO RecordsEnd
··· WRITE eeIndex, 0
· NEXT
· DEBUG CR, "Records cleared."
· PAUSE 1000
· RETURN

' -----[ Subroutine - Record_Data ]-------------------------------------------

Record_Data:


· PAUSE 200

· DEBUG CLS, "Recording..."

· FOR eeIndex = Records TO RecordsEnd STEP 2

··· PULSIN Xin, HiPulse, xRaw···················· ' read pulse output

····· xRaw = xRaw */ Scale························· ' convert to uSecs
····· xmG = ((xRaw / 10) - 500) * 8················ ' calc 1/1000 g




··· PULSIN Yin, HiPulse, yRaw

····· yRaw = yRaw */ Scale
····· ymG = ((yRaw / 10) - 500) * 8

···· DEBUG DEC eeIndex, CRSRX, 7, (xmG.BIT15 * 13 + " "),
········· DEC (ABS xmG / 1000), ".", DEC3 (ABS xmG), " g", CRSRX, 14, (ymG.BIT15 * 13 + " "),
········· DEC (ABS ymG / 1000), ".", DEC3 (ABS ymG), " g", CR

··· WRITE eeIndex, xmG
··· WRITE eeIndex + 1, ymG

· NEXT


· PAUSE 950

· DEBUG CR, "End of records.",
······· CR, "Press Enter for menu..."
· DEBUGIN char

· RETURN

' -----[ Subroutine - Display_Data ]------------------------------------------

Display_Data:

· DEBUG CR, "Index· x-axis· y-axis",
······· CR, "-----· ------· ------",
······· CR
· FOR eeIndex = Records TO RecordsEnd STEP 2
··· READ eeIndex, xmG1

··· READ eeIndex + 1, ymG1

··· DEBUG DEC eeIndex, CRSRX, 7, (xmG1.BIT15 * 13 + " "),
········· DEC (ABS xmG1 / 1000), ".", DEC3 (ABS xmG1), " g", CRSRX, 14, (ymG1.BIT15 * 13 + " "),
········· DEC (ABS ymG1 / 1000), ".", DEC3 (ABS ymG1), " g", CR
· NEXT
· DEBUG CR, "Press Enter for menu..."
· DEBUGIN char
· RETURN


'Get_Gforce:
·' DO
· '· PAUSE 25··························· ' small loop pad
·· ' OWIN 6, 4, [Xin]··················· ' check status (bit transfer)
·' LOOP UNTIL (Xin)····················· ' 1 when complete
· 'OWOUT 6, 1, ["b", 1, SDEC4 xmG]··············· ' read DS1822 scratchpad
· 'OWIN· 6, 2, [Xin, Yin]··············· ' get raw temp data
· 'RETURN

And the corresponding data:


Recordi 0.424· 0.360 g
3······ 0.456· 0.432 g
5······ 0.512· 0.352 g
7······ 0.576 -0.264 g
9······ 0.328 -0.208 g
11····· 0.232· 0.448 g
13····· 0.504· 2.096 g
15···· -0.584 -1.168 g
17···· -1.568 -2.616 g
19···· -0.296 -0.544 g
21···· -0.576· 25.736 g
23····· 0.072· 0.376 g
25···· -0.840 -3.472 g
27···· -0.968 -0.920 g
29····· 0.080· 25.536 g
31···· -0.152· 0.328 g
33···· -1.192 -3.872 g
35···· -0.624 -1.368 g
37···· -1.200· 3.248 g
39···· -0.560· 1.832 g
41···· -0.960 -2.072 g
43···· -1.632 -2.024 g
45···· -0.624· 1.992 g
47···· -0.264· 1.416 g
49···· -0.160 -0.824 g
51···· -0.720 -3.264 g
53···· -0.568 -0.224 g
55···· -0.056· 2.824 g
57···· -0.256 -0.952 g
59···· -1.040 -2.512 g
61···· -0.040· 0.216 g
63····· 0.616· 2.344 g
65···· -0.112 -1.048 g
67···· -0.816 -2.312 g
69···· -0.320· 0.640 g
71····· 0.448· 1.520 g
73····· 0.208 -1.968 g
75···· -0.640 -1.632 g
77···· -0.080· 1.520 g
79····· 0.168· 0.792 g
81····· 0.424 -1.360 g
83···· -0.312 -1.544 g
85···· -0.080· 1.584 g
87····· 0.576 -0.016 g
89····· 0.280 -1.896 g
91···· -0.088 -0.568 g
93····· 0.472· 1.720 g
95····· 0.496 -1.008 g
97···· -0.096 -1.232 g
99····· 0.008· 1.144 g
101···· 0.632· 0.016 g
103···· 0.584 -1.032 g
105···· 0.152 -1.072 g
107···· 0.088· 1.248 g
109···· 0.496 -0.328 g
111···· 0.456 -1.224 g
113···· 0.128· 0.544 g
115···· 0.600 -0.600 g
117···· 0.312 -1.264 g
119···· 0.144 -0.256 g
121···· 0.888· 0.224 g
123···· 0.552 -1.048 g
125···· 0.296 -1.112 g
127···· 0.296 -0.496 g
129···· 1.136· 0.736 g
131···· 0.368 -1.264 g
133··· -0.008 -1.224 g
135···· 0.256 -0.352 g
137···· 0.968· 0.488 g
139···· 0.432 -1.080 g
141···· 0.232 -1.280 g
143···· 0.360 -0.056 g
145···· 0.872· 0.144 g
147···· 0.504 -1.160 g
149···· 0.192 -0.984 g
151···· 0.296· 0.800 g
153···· 0.528 -0.952 g
155···· 0.024 -1.328 g
157···· 0.008· 0.072 g
159···· 0.840 -0.376 g
161···· 0.328 -1.344 g
163···· 0.168 -0.880 g
165···· 0.480· 0.216 g
167···· 0.664 -0.576 g
169···· 0.176 -1.256 g
171···· 0.024 -0.160 g
173···· 0.952 -0.200 g
175···· 0.528 -1.208 g
177···· 0.104 -1.184 g
179···· 0.104· 0.192 g
181···· 0.672 -0.624 g
183···· 0.288 -1.176 g
185··· -0.008 -0.592 g
187···· 1.040· 0.144 g
189···· 0.472 -1.072 g
191···· 0.128 -1.480 g
193··· -0.176 -0.752 g
195···· 1.136· 0.496 g
197···· 0.640 -1.280 g
199···· 0.064 -0.856 g
201···· 0.368· 0.432 g
203···· 0.624 -0.096 g
205···· 0.256 -1.488 g
207···· 0.088 -1.416 g
209··· -0.096 -0.080 g
211···· 1.008 -0.224 g
213···· 0.456 -1.472 g
215··· -0.224 -1.016 g
217···· 0.480· 0.464 g
219···· 0.648 -0.688 g
221···· 0.608 -1.272 g
223··· -0.032 -0.152 g
225···· 0.736· 0.136 g
227···· 0.536 -0.984 g
229···· 0.296 -1.160 g
231···· 0.184 -0.072 g
233···· 0.792 -0.280 g
235···· 0.640 -1.176 g
237···· 0.328 -0.752 g
239···· 0.544· 0.008 g
241···· 0.704 -1.104 g
243···· 0.152 -0.968 g
245···· 0.248 -0.128 g
247···· 0.632 -0.656 g
249···· 0.224 -1.192 g
251···· 0.248 -0.552 g
253···· 0.728· 0.296 g
255···· 0.768 -0.752 g
257···· 0.304 -0.992 g
259···· 0.192 -0.464 g
261···· 0.984· 0.544 g
263···· 0.792 -0.952 g
265···· 0.032 -0.800 g
267···· 0.152· 0.304 g
269···· 0.648 -0.632 g
271···· 0.312 -1.064 g
273···· 0.064· 0.280 g
275···· 0.720 -0.248 g
277···· 0.784 -1.104 g
279···· 0.032 -0.264 g
281···· 0.816· 0.184 g
283···· 0.744 -0.960 g
285···· 0.216 -0.712 g
287···· 0.240· 0.160 g
289···· 0.912 -0.472 g
291···· 0.528 -0.880 g
293··· -0.088· 0.192 g
295···· 0.728 -0.496 g
297···· 0.528 -0.928 g
299···· 0.176 -0.304 g
301···· 0.904· 0.216 g
303···· 1.024 -0.688 g
305···· 0.088 -0.168 g
307···· 0.720· 0.048 g
309···· 0.872 -0.952 g
311···· 0.176 -0.416 g
313···· 0.672· 0.608 g
315···· 0.896 -0.392 g
317···· 0.224 -0.656 g
319···· 0.232· 0.736 g
321···· 0.696 -0.296 g
323···· 0.376 -0.608 g
325···· 0.256· 0.584 g
327···· 0.880 -0.408 g
329···· 0.168 -0.560 g
331···· 0.536· 0.304 g
333···· 0.768 -0.216 g
335···· 0.424 -0.592 g
337···· 0.144· 0.608 g
339···· 0.712 -0.192 g
341···· 0.600 -0.776 g
343···· 0.128· 0.752 g
345···· 0.704 -0.056 g
347···· 0.608 -0.584 g
349···· 0.016· 0.640 g
351···· 0.712 -0.328 g
353···· 0.520 -0.744 g
355···· 0.376· 0.376 g
357···· 0.800 -0.056 g
359···· 0.560 -0.696 g
361···· 0.216· 0.016 g
363···· 0.840· 0.200 g
365···· 0.696 -0.808 g
367···· 0.248 -0.384 g
369···· 0.928· 0.576 g
371···· 0.888 -0.744 g
373···· 0.064 -0.552 g
375···· 0.776· 0.624 g
377···· 1.032 -0.968 g
379···· 0.152 -0.456 g
381···· 0.448· 0.616 g
383···· 0.792· 0.096 g
385···· 0.592 -0.904 g
387···· 0.264 -0.832 g
389···· 0.560 -0.176 g
391···· 0.824 -0.112 g
393···· 0.320· 0.296 g
395···· 0.352· 0.408 g
397···· 0.432· 0.368 g
399···· 0.296· 0.488 g
401···· 0.544· 0.040 g
403···· 0.592 -0.144 g
405···· 0.688· 0.008 g
407···· 0.632· 0.120 g
409···· 0.632 -0.056 g
411···· 0.744 -0.432 g
413···· 0.336· 18.008 g
415··· -0.240 -2.648 g
417··· -0.640 -3.904 g
419··· -0.328 -0.624 g
421··· -0.136· 1.824 g
Press/Release Reset
to arm datalogger
·- or -
Type C, R or W
C - Clear records
R - Record records
W - Display records
>w
Index· x-axis· y-axis
-----· ------· ------
1······ 0.168· 0.104 g
3······ 0.200· 0.176 g
5······ 0.000· 0.096 g
7······ 0.064· 0.248 g
9······ 0.072· 0.048 g
11····· 0.232· 0.192 g
13····· 0.248· 0.048 g
15····· 0.184· 0.112 g
17····· 0.224· 0.200 g
19····· 0.216· 0.224 g
21····· 0.192· 0.136 g
23····· 0.072· 0.120 g
25····· 0.184· 0.112 g
27····· 0.056· 0.104 g
29····· 0.080· 0.192 g
31····· 0.104· 0.072 g
33····· 0.088· 0.224 g
35····· 0.144· 0.168 g
37····· 0.080· 0.176 g
39····· 0.208· 0.040 g
41····· 0.064· 0.232 g
43····· 0.160· 0.024 g
45····· 0.144· 0.200 g
47····· 0.248· 0.136 g
49····· 0.096· 0.200 g
51····· 0.048· 0.064 g
53····· 0.200· 0.032 g
55····· 0.200· 0.008 g
57····· 0.000· 0.072 g
59····· 0.240· 0.048 g
61····· 0.216· 0.216 g
63····· 0.104· 0.040 g
65····· 0.144· 0.232 g
67····· 0.208· 0.248 g
69····· 0.192· 0.128 g
71····· 0.192· 0.240 g
73····· 0.208· 0.080 g
75····· 0.128· 0.160 g
77····· 0.176· 0.240 g
79····· 0.168· 0.024 g
81····· 0.168· 0.176 g
83····· 0.200· 0.248 g
85····· 0.176· 0.048 g
87····· 0.064· 0.240 g
89····· 0.024· 0.152 g
91····· 0.168· 0.200 g
93····· 0.216· 0.184 g
95····· 0.240· 0.016 g
97····· 0.160· 0.048 g
99····· 0.008· 0.120 g
101···· 0.120· 0.016 g
103···· 0.072· 0.248 g
105···· 0.152· 0.208 g
107···· 0.088· 0.224 g
109···· 0.240· 0.184 g
111···· 0.200· 0.056 g
113···· 0.128· 0.032 g
115···· 0.088· 0.168 g
117···· 0.056· 0.016 g
119···· 0.144· 0.000 g
121···· 0.120· 0.224 g
123···· 0.040· 0.232 g
125···· 0.040· 0.168 g
127···· 0.040· 0.016 g
129···· 0.112· 0.224 g
131···· 0.112· 0.016 g
133···· 0.248· 0.056 g
135···· 0.000· 0.160 g
137···· 0.200· 0.232 g
139···· 0.176· 0.200 g
141···· 0.232· 0.000 g
143···· 0.104· 0.200 g
145···· 0.104· 0.144 g
147···· 0.248· 0.120 g
149···· 0.192· 0.040 g
151···· 0.040· 0.032 g
153···· 0.016· 0.072 g
155···· 0.024· 0.208 g
157···· 0.008· 0.072 g
159···· 0.072· 0.136 g
161···· 0.072· 0.192 g
163···· 0.168· 0.144 g
165···· 0.224· 0.216 g
167···· 0.152· 0.192 g
169···· 0.176· 0.024 g
171···· 0.024· 0.096 g
173···· 0.184· 0.056 g
175···· 0.016· 0.072 g
177···· 0.104· 0.096 g
179···· 0.104· 0.192 g
181···· 0.160· 0.144 g
183···· 0.032· 0.104 g
185···· 0.248· 0.176 g
187···· 0.016· 0.144 g
189···· 0.216· 0.208 g
191···· 0.128· 0.056 g
193···· 0.080· 0.016 g
195···· 0.112· 0.240 g
197···· 0.128· 0.000 g
199···· 0.064· 0.168 g
201···· 0.112· 0.176 g
203···· 0.112· 0.160 g
205···· 0.000· 0.048 g
207···· 0.088· 0.120 g
209···· 0.160· 0.176 g
211···· 0.240· 0.032 g
213···· 0.200· 0.064 g
215···· 0.032· 0.008 g
217···· 0.224· 0.208 g
219···· 0.136· 0.080 g
221···· 0.096· 0.008 g
223···· 0.224· 0.104 g
225···· 0.224· 0.136 g
227···· 0.024· 0.040 g
229···· 0.040· 0.120 g
231···· 0.184· 0.184 g
233···· 0.024· 0.232 g
235···· 0.128· 0.104 g
237···· 0.072· 0.016 g
239···· 0.032· 0.008 g
241···· 0.192· 0.176 g
243···· 0.152· 0.056 g
245···· 0.248· 0.128 g
247···· 0.120· 0.112 g
249···· 0.224· 0.088 g
251···· 0.248· 0.216 g
253···· 0.216· 0.040 g
255···· 0.000· 0.016 g
257···· 0.048· 0.032 g
259···· 0.192· 0.048 g
261···· 0.216· 0.032 g
263···· 0.024· 0.072 g
265···· 0.032· 0.224 g
267···· 0.152· 0.048 g
269···· 0.136· 0.136 g
271···· 0.056· 0.216 g
273···· 0.064· 0.024 g
275···· 0.208· 0.008 g
277···· 0.016· 0.176 g
279···· 0.032· 0.248 g
281···· 0.048· 0.184 g
283···· 0.232· 0.064 g
285···· 0.216· 0.056 g
287···· 0.240· 0.160 g
289···· 0.144· 0.040 g
291···· 0.016· 0.144 g
293···· 0.168· 0.192 g
295···· 0.216· 0.016 g
297···· 0.016· 0.096 g
299···· 0.176· 0.208 g
301···· 0.136· 0.216 g
303···· 0.000· 0.080 g
305···· 0.088· 0.088 g
307···· 0.208· 0.048 g
309···· 0.104· 0.072 g
311···· 0.176· 0.096 g
313···· 0.160· 0.096 g
315···· 0.128· 0.120 g
317···· 0.224· 0.112 g
319···· 0.232· 0.224 g
321···· 0.184· 0.216 g
323···· 0.120· 0.160 g
325···· 0.000· 0.072 g
327···· 0.112· 0.104 g
329···· 0.168· 0.208 g
331···· 0.024· 0.048 g
333···· 0.000· 0.040 g
335···· 0.168· 0.176 g
337···· 0.144· 0.096 g
339···· 0.200· 0.064 g
341···· 0.088· 0.248 g
343···· 0.128· 0.240 g
345···· 0.192· 0.200 g
347···· 0.096· 0.184 g
349···· 0.016· 0.128 g
351···· 0.200· 0.184 g
353···· 0.008· 0.024 g
355···· 0.120· 0.120 g
357···· 0.032· 0.200 g
359···· 0.048· 0.072 g
361···· 0.216· 0.016 g
363···· 0.072· 0.200 g
365···· 0.184· 0.216 g
367···· 0.248· 0.128 g
369···· 0.160· 0.064 g
371···· 0.120· 0.024 g
373···· 0.064· 0.216 g
375···· 0.008· 0.112 g
377···· 0.008· 0.056 g
379···· 0.152· 0.056 g
381···· 0.192· 0.104 g
383···· 0.024· 0.096 g
385···· 0.080· 0.120 g
387···· 0.008· 0.192 g
389···· 0.048· 0.080 g
391···· 0.056· 0.144 g
393···· 0.064· 0.040 g
395···· 0.096· 0.152 g
397···· 0.176· 0.112 g
399···· 0.040· 0.232 g
401···· 0.032· 0.040 g
403···· 0.080· 0.112 g
405···· 0.176· 0.008 g
407···· 0.120· 0.120 g
409···· 0.120· 0.200 g
411···· 0.232· 0.080 g
413···· 0.080· 0.088 g
415···· 0.016· 0.168 g
417···· 0.128· 0.192 g
419···· 0.184· 0.144 g
421···· 0.120· 0.032 g
423···· 0.168· 0.040 g
425···· 0.128· 0.080 g
427···· 0.008· 0.008 g
429···· 0.000· 0.000 g
431···· 0.128· 0.176 g
433···· 0.136· 0.104 g
435···· 0.064· 0.216 g
437···· 0.152· 0.248 g
439···· 0.040· 0.144 g
441···· 0.104· 0.144 g
443···· 0.144· 0.112 g
445···· 0.120· 0.088 g
447···· 0.128· 0.112 g
449···· 0.200· 0.224 g
451···· 0.224· 0.112 g
453···· 0.080· 0.160 g
455···· 0.056· 0.088 g
457···· 0.168· 0.168 g
459···· 0.016· 0.088 g
461···· 0.160· 0.184 g
463···· 0.160· 0.224 g
465···· 0.136· 0.120 g
467···· 0.128· 0.248 g
469···· 0.216· 0.216 g
471···· 0.096· 0.016 g
473···· 0.128· 0.088 g
475···· 0.144· 0.096 g
477···· 0.144· 0.112 g
479···· 0.120· 0.032 g
481···· 0.072· 0.088 g
483···· 0.168· 0.056 g
485···· 0.112· 0.024 g
487···· 0.128· 0.240 g
489···· 0.152· 0.032 g
491···· 0.240· 0.136 g
493···· 0.064· 0.088 g
495···· 0.024· 0.248 g
497···· 0.040· 0.016 g
499···· 0.080· 0.192 g
501···· 0.152· 0.080 g

kuenyls
02-26-2010, 04:12 AM
the same data is acquired if we change step 2 to step 4 and the eeindex +1 to +2

Mike Green
02-26-2010, 04:27 AM
Try what I suggested. Your "xmG" and "ymG" are 16 bit values, yes? Then you have to write them to EEPROM as 16 bit values as I suggested before. Then you have to read them as 16 bit values and convert them into printable/displayable form. 16 bits is two bytes and you have to adjust the byte address accordingly (by 2) for each value.

Your program is reading and writing 8 bit values only and the upper 8 bits of each of "xmG" and "ymG" will be ignored.

Post Edited (Mike Green) : 2/25/2010 8:35:04 PM GMT

kuenyls
02-26-2010, 07:21 AM
Thank you so much. I'm sorry. The simplest things make such a difference. I really appreciate all of your help.

-Laura

Mike Green
02-26-2010, 07:36 AM
You're welcome.

Computers are like that. They do what you tell them to do, not necessarily what you want. It helps if you learn how to forget everything you know about your program and look at it as if you were the computer, taking everything literally. Sometimes pretending on paper that you're your program helps. You get a big sheet of paper and make lined columns. Each column is a variable and the lines are execution steps and you literally write down what the individual statements do to the variable values being very careful not to make any assumptions.