![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
tieungu13
Joined: 03 Mar 2010 Posts: 6
|
one question about SHT71 |
Posted: Thu Jul 08, 2010 11:26 am |
|
|
I used Sht71. Driver of sht71 I got on this website, and example I get on this website too. But I get value of Temp = -39.9 and hump = -4.6% all the time. Pin of sht71 PIN_1 (PC0 - clock), 2 (VCC pull 10K), 3 (Ground), 4 (Data and pull 10k -PIN C1). Like on datasheet of SHT7X. I see on the topic about SHT71 this website someone had a problem like me, but they haven't solved this problem. Help me. I'm from VietNam.
Code: |
//////////////////////////////////////main C /////////////////////////
#include "C:\Users\Thanh Hai\Desktop\test71\main.h"
#fuses HS,NOWDT,PUT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include <SHT71.c>
#include <lcd_lib_4bit.c>
void main()
{
float restemp, truehumid;
set_tris_c(0xff);
lcd_init();
sht_init();
output_low(PIN_C0);///
output_high(PIN_C1);
while(1)
{
restart_wdt();
sht_rd (restemp, truehumid);
LCD_SetPosition(0);
printf(LCD_putchar, "Temp : %3.1f C ",restemp);
LCD_SetPosition(40);
printf(LCD_putchar, "\nRH : %3.1f %% ", truehumid);
delay_ms(50); //delay 500 ms between reading to prevent self heating of sensor
}
}
|
Code: |
//////////////////////////////SHT71////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// //
// Driver file for SHT75 Temperature & Humidity Sensor //
// //
// ***** To initialise SHT75 sensor upon power up ***** //
// //
// Function : sht_init() //
// Return : none //
// //
// //
// ***** To measure and caluculate SHT75 temp & real RH ***** //
// //
// Function : sht_rd (temp, truehumid) //
// Return : temperature & true humidity in float values //
// //
///////////////////////////////////////////////////////////////////////////////
#define sht_data_pin PIN_C1
#define sht_clk_pin PIN_C0
|
SHT71 Driver:
http://www.ccsinfo.com/forum/viewtopic.php?t=28564 |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Mon Jul 12, 2010 1:09 am |
|
|
Sounds like you may have connected it up wrongly and then killed it. Been there, done that. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|