Shop OBEX P1 Docs P2 Docs Learn Events
Inconsistencies Between DEBUG and SEROUT to LCD — Parallax Forums

Inconsistencies Between DEBUG and SEROUT to LCD

HyblademinHyblademin Posts: 4
edited 2010-07-19 06:14 in BASIC Stamp
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:

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

  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-18 16:12
    That doesn't make any sense. What characters are shown on the DEBUG window and on the LCD? Where in the program do you have these statements?

    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
  • HyblademinHyblademin Posts: 4
    edited 2010-07-19 06:14
    Actually, that was my problem. Thanks for pointing that out, as it would have taken me ages to realize on my own.
Sign In or Register to comment.