« Close

Datasheets and User Guides

App Notes

Software & Driver

 

4.31 - SHT1X

This function retrieves temperature and/or humidity readings from an SHT1X sensor. Data rate is about 2 kbps with firmware V1.1 or higher (hardware communication). If firmware is less than V1.1, or TRUE is passed for softComm, data rate is about 20 bps.

DATA = IO0
SCK = IO1

The EI-1050 has an extra enable line that allows multiple probes to be connected at the same time using only the one line for DATA and one line for SCK. This function does not control the enable line.

This function automatically configures IO0 has an input and IO1 as an output.

Note that internally this function operates on the state and direction of IO0 and IO1, and to operate on any of the IO lines the LabJack must operate on all 4. The DLL keeps track of the current direction and output state of all lines, so that this function can operate on IO0 and IO1 without changing IO2 and IO3. When the DLL is first loaded, though, it does not know the direction and state of the lines and assumes all directions are input and output states are low.

Declaration:

long SHT1X (    long *idnum,
                long demo,
                long softComm,
                long mode,
                long statusReg,
                float *tempC,
                float *tempF,
                float *rh)

Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:

  • *idnum – Local ID, serial number, or -1 for first found.
  • demo – Send 0 for normal operation, >0 for demo mode. Demo mode allows this function to be called without a LabJack.
  • softComm – If >0, forces software based communication. Otherwise software communication is only used if the LabJack U12 firmware version is less than V1.1.
  • mode – 0=temp and RH,1=temp only,2=RH only. If mode is 2, the current temperature must be passed in for the RH corrections using *tempC.
  • statusReg – Current value of the SHT1X status register. The value of the status register is 0 unless you have used advanced functions to write to the status register (enabled heater, low resolution, or no reload from OTP).

Outputs:

  • *idnum – Returns the local ID or –1 if no LabJack is found.
  • *tempC – Returns temperature in degrees C. If mode is 2, the current temperature must be passed in for the RH corrections.
  • *tempF – Returns temperature in degrees F.
  • *rh – Returns RH in percent.