Hey there I am a complete beginner with Arduino, as well a newcomer to the forum. I have trying to get my SHT1 sensor to begin reading. I downloaded the source code for the sensor but when i validate i get this error message.
In file included from ReadSHT1xValues.pde:16:
\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:111: error: expected ',' or '...' before numeric constant
\arduino\New folder\arduino-1.0.5\hardware\arduino\cores\arduino/Arduino.h:112: error: expected ',' or '...' before numeric constant
ReadSHT1xValues:16: error: 'SHT1x' does not name a type
ReadSHT1xValues.pde: In function 'void loop()':
ReadSHT1xValues:31: error: 'sht1x' was not declared in this scope
The source code i downloaded is below if anyone could shed some light on this issue I would greatly appreciate it!
Regards,
Chris
/**
* ReadSHT1xValues
*
* Read temperature and humidity values from an SHT1x-series (SHT10,
* SHT11, SHT15) sensor.
*
* Copyright 2009 Jonathan Oxer <jon@oxer.com.au>
* www.practicalarduino.com
*/
#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);