Shop OBEX P1 Docs P2 Docs Learn Events
Display Data from PINK — Parallax Forums

Display Data from PINK

DosEdgeDosEdge Posts: 33
edited 2007-01-26 22:52 in BASIC Stamp
I was trying to figure out how to display data from the PINK card back into a web page (HTML).· If anyone can give any advise, it would be really appreciated!

Thanks,

DosEdge

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-01-25 22:51
    Can you give a better description of what you are trying to do?-
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-25 23:34
    Hello,

    Page 6 of the documentation shows how to display variables on a web page. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • DosEdgeDosEdge Posts: 33
    edited 2007-01-26 21:10
    This a·portion code used for the project

    TempBinCode VAr Word············ 'declared variable for the temp code from DS1620

    Sign Var TempBinCode.Bit8·········'takes the most significant bit to determine its sign value

    Temp_Sign Var Bit·····················'holds the temp sign value

    SHIFTIN DQ,CLK,LSBPRE,[noparse][[/noparse]DSdata\9]·· 'Command for DS1620 to send binary temperature code back to BS2
    LOW RST······································ 'Deactivate the DS1620
    Temp_Sign =Sign····························'(expletive)ign the most significant bit to Temp_Sign of
    TempBinCode= TempBinCode/2··········' Covert TempBinCode to C degrees
    IF Temp_Sign = 0 THEN·BelowZero1···'Determine if not below·zero·to Below Zero

    TempBinCode = TempBinCode|$FF00·· 'if·negative extend the bits

    Below Zero:
    'DEBUG SDEC TempBinCode,"degrees C", CR··' Trying to replace this DEBUG command·with a SEROUT command so I·can send the temperature value to a PINK variable so it can be displayed in a web page that I created.· SEROUT 8, 386,[noparse][[/noparse]"!NB0W20: TempBinCode", CLS]· displays the string 'TempBinCode', but not the actually temperature value calculated in the PINK variable Nb_var20.

    · TemBinCode=(TempBinCode*/$01CC)
    IF Temp_Sign = 0 THEN BelowZero2
    ··TempBinCode = TempBinCode|$FF00
    BelowZero2:
    ··TempBinCode =·TempBinCode +32
    · DEBUG SDEC TempBinCode, "degrees F", CR



    I need help with infrastructure for sending the calculated temp value from the·DS1620 to the BS2 then send that value to a PINK variable to be used in a web display
  • FranklinFranklin Posts: 4,747
    edited 2007-01-26 21:17
    does this work? SEROUT 8, 386,[noparse][[/noparse]"!NB0W20: "TempBinCode, CLS]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-26 21:23
    Actually, you would need to use something like...

    SEROUT 8, 386,[noparse][[/noparse]"!NB0W20:", DEC TempBinCode, CLS]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • DosEdgeDosEdge Posts: 33
    edited 2007-01-26 22:52
    The Situation is resolved!!!!!!

    The portion of code below allows the user to retrieve the temperature from the DS1620 and send it to a PINK's variable·Nb_var20 to·be displayed in a web page(html). Using BS2 SEROUT command to send the temperature to the PINK. The code works fine!

    TempBinCode VAr Word············ 'declared variable for the temp code from DS1620

    Sign Var TempBinCode.Bit8·········'takes the most significant bit to determine its sign value

    Temp_Sign Var Bit·····················'holds the temp sign value

    HIGH RST

    SHIFTIN DQ,CLK,LSBPRE,[noparse][[/noparse]DSdata\9]·· 'Command for DS1620 to send binary temperature code back to BS2
    LOW RST······································ 'Deactivate the DS1620
    Temp_Sign =Sign····························'(expletive)ign the most significant bit to Temp_Sign of
    TempBinCode= TempBinCode/2··········' Covert TempBinCode to C degrees
    IF Temp_Sign = 0 THEN·BelowZero1···'Determine if not below·zero·to Below Zero

    TempBinCode = TempBinCode|$FF00·· 'if·negative extend the bits

    Below Zero:

    SEROUT 8, 386,[noparse][[/noparse]"!NB0W20:", DEC TempBinCode, CLS]


    TemBinCode=(TempBinCode*/$01CC)
    IF Temp_Sign = 0 THEN BelowZero2
    ··TempBinCode = TempBinCode|$FF00
    BelowZero2:
    ··TempBinCode =·TempBinCode +32
Sign In or Register to comment.