Inconsistencies Between DEBUG and SEROUT to LCD
Hyblademin
Posts: 4
Using a 2 x 16 Parallax Serial LCD, I find different values displayed in the debug pane and on the LCD when the two are used in sequence in the source code:
The code they are being tested in is an unmodified (besides my insertion of SEROUT lines) "TestCalibratedHM55BCompass.bs2", which is found on the resource page for the Hitachi HM55B Compass Module on Parallax's store.
Note: The values displayed for the variables are radically different, where the angle should only be 0-359, but displayed values of up to 750 before wrapping to 150 on the LCD when the compass is rotated. The x and y values are also wrong by factors of 100-1000, showing magnitudes in the area of + or -45000. Correct values are displayed on the debug window.
Post Edited (Hyblademin) : 7/18/2010 4:12:07 PM GMT
DEBUG HOME, DEC angle SEROUT DPin, 84, [noparse][[/noparse]128, DEC angle]
The code they are being tested in is an unmodified (besides my insertion of SEROUT lines) "TestCalibratedHM55BCompass.bs2", which is found on the resource page for the Hitachi HM55B Compass Module on Parallax's store.
Note: The values displayed for the variables are radically different, where the angle should only be 0-359, but displayed values of up to 750 before wrapping to 150 on the LCD when the compass is rotated. The x and y values are also wrong by factors of 100-1000, showing magnitudes in the area of + or -45000. Correct values are displayed on the debug window.
Post Edited (Hyblademin) : 7/18/2010 4:12:07 PM GMT
Comments
Remember that the "128" only positions the cursor to the start of the display. It doesn't erase what's already there. You may be seeing the previous values overlaid with the new value. Try SEROUT DPin,84,[noparse][[/noparse]128,DEC angle," "]
Post Edited (Mike Green) : 7/18/2010 4:18:15 PM GMT