Shop OBEX P1 Docs P2 Docs Learn Events
Whats the trick? — Parallax Forums

Whats the trick?

GuidoGuido Posts: 195
edited 2004-11-10 06:51 in BASIC Stamp
Good Morning all,
What is the trick expressimg the following debug function to Stamp Plot Lite.
Trying to Plot neg Temperatures?

DEBUG REP "-"\TEMPF.BIT15,DEC1 TEMPF," F ",CR·

Thanks for the Help!!!!!!

Comments

  • kelvin jameskelvin james Posts: 531
    edited 2004-11-08 17:40
    In pbasic, signed numbers(negative) to be shown have to use the " SDEC" format and a word sized variable. not sure about stamp plot lite, never used it, don't know if there is any difference. lots of debug info in the manual.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-11-08 18:28
    Maybe you need something like the following:

    ... DEBUG REP "-"\tempF.BIT15,ABS DEC tempF/10,".",DEC1 ABS tempF," F ",CR·

    Neither the /10 nor the DEC1 modifier will work when the number is negative (twos complement). If the temperature represents a whole number (twos complement, no decimal point implied), then the SDEC modifier will work:
    ... DEBUG SDEC tempF, "F",CR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • GuidoGuido Posts: 195
    edited 2004-11-08 20:38
    Tracy,
    Thanks for the Help. I have been playing around with trying to save variable space and using Allan Lanes suggestion. Attached is the following program that indeed will to my knowledge work at least to -9 degrees F. At the Time I was asking for help I was not looking at Negative numbers...But since then I though it would be great to have three sensor monitoring three seperate locations and one could go down at least to -10F.
    I tried your advice for displaying a negative Tempf for Stamp Plot lite, but would not work...Do you have any other suggestions?
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-11-09 03:32
    Did you try this to your debug screen...

    DEBUG REP "-"\tempF.BIT15,ABS DEC tempF/10,".",DEC1 ABS tempF," F ",CR

    ...ust to be sure that the values are good? If it works on your debug screen, I don't know why it would not work with Stamp Plot Lite.

    It should work down to -40 degrees, the limit of the sensor chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • GuidoGuido Posts: 195
    edited 2004-11-09 13:36
    Tracy,

    Again Thank you for all the help. I am actually slowly learning what I am doing. Yes to you question, it works perfectly in the debug screen, but will not plot on Stamp Plot Lite. It will display the correct reading in the Message window but will only plot if you use something like this:

    DEBUG TEMPF,CR

    I am sure it has to do with the negative sign. I was thinking that there may be a trick to have Stamp Plot Lite accept and plot as a negative....·Any Ideas or is this just the Basic Stamp unable to handle negative factors with Stamp Plot Lite.

    Guido
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-11-09 20:48
    I'm not familiar enough with Stamp Plot Lite to answer your question, whether or not it can accwpt either decimal points or negative numbers. Maybe someone else knows. Same question for Stamp Plot Pro.

    If you have Excel, maybe you could use that to chart your data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • kelvin jameskelvin james Posts: 531
    edited 2004-11-10 06:51
    just for interest sake and curiousity, i took a look at stamp plot and some of the documentation. The plot scale maximum and minimum can be adjusted to what you want, but unfortunately, the range seems to be only from 0 to 255 or inbetween. Maybe you should try and contact support at the web site? The pro looks pretty cool. kelvin
Sign In or Register to comment.