Pages: [1]   Go Down
Author Topic: Temperature Sensor SHT15 error!  (Read 921 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there!

I'm having this error:

In file included from sketch_oct16a.cpp:1:
C:\Users\Desktop\arduino-1.0.1\libraries\SHT1x/SHT1x.h:15:22: error: WProgram.h: No such file or directory
In file included from sketch_oct16a.cpp:6:
C:\Users\Desktop\arduino-1.0.1\hardware\arduino\cores\arduino/Arduino.h:111: error: expected ',' or '...' before numeric constant
C:\Users\Desktop\arduino-1.0.1\hardware\arduino\cores\arduino/Arduino.h:112: error: expected ',' or '...' before numeric constant

I downloaded the SHT1x library and installed in My documents/Arduino/libraries. However, it wasnt shown in File/Examples of the arduino. What is missing still?


This is the code:

#include <SHT1x.h>
// Specify data and clock connections and instantiate SHT1x object
#define dataPin  10
#define clockPin 11
SHT1x sht1x(dataPin, clockPin);
 
void setup()
{
   Serial.begin(38400); // Open serial connection to report values to host
   Serial.println("Starting up");
}
 
void loop()
{
  float temp_c;
  float temp_f;
  float humidity;
 
  // Read values from the sensor
  temp_c = sht1x.readTemperatureC();
  temp_f = sht1x.readTemperatureF();
  humidity = sht1x.readHumidity();
 
  // Print the values to the serial port
  Serial.print("Temperature: ");
  Serial.print(temp_c, DEC);
  Serial.print("C / ");
  Serial.print(temp_f, DEC);
  Serial.print("F. Humidity: ");
  Serial.print(humidity);
  Serial.println("%");
 
  delay(2000);
}
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8937
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In file included from sketch_oct16a.cpp:1:
C:\Users\Desktop\arduino-1.0.1\libraries\SHT1x/SHT1x.h:15:22: error: WProgram.h: No such file or directory

The library has not been updated for Arduino 1.0/1.0.1.

Change "WProgram.h" to "Arduino.h" in the file C:\Users\Desktop\arduino-1.0.1\libraries\SHT1x/SHT1x.h
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow! Thanks man!
Logged

Pages: [1]   Go Up
Jump to: