Display Data from PINK
DosEdge
Posts: 33
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
Thanks,
DosEdge
Comments
Page 6 of the documentation shows how to display variables on a web page. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
SEROUT 8, 386,[noparse][[/noparse]"!NB0W20:", DEC TempBinCode, CLS]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
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