Problem with DallasTemperature.h

Hello

I started to paly with Dallas items. I created simple code. I couldn’t start because when I added DallasTemperature.h I recived big error.
Maybe it’s small mistake but I couldn’t find it :confused:
Please help.

C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:31:24: error: WConstants.h: No such file or directory
C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp: In member function 'virtual float BSeries::getTemperature(NewOneWire*)':
C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:42: error: 'byte' was not declared in this scope
C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:42: error: expected `;' before 'lowByte'
C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:43: error: expected `;' before 'highByte'
C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:47: error: 'highByte' was not declared in this scope
C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:47: error: 'lowByte' was not declared in this scope

My code:

#include <LiquidCrystal.h>
#include <DallasTemperature.h>
#include <OneWire.h>

// Connections:
// rs (LCD pin 4) do pinu 12 Arduino
// rw (LCD pin 5) do pinu 11 Arduino
// enable (LCD pin 6) do pin 10 Arduino
// LCD pin 15 do pinu 13 Arduino
// LCD pins d4, d5, d6, d7 do pinów 5, 4, 3, 2 Arduino

DallasTemperature tempSensor;
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

int backLight = 13;    // pin 13 kontroluje pod?wietlenie
float temp;

void setup(void)
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH);    // 'HIGH' za??ncza pod?wietlenie, 'LOW' wy?ancza.
  lcd.begin(16,2);                  // Kolumny, rz?dy.  16,2 dla 16x2 LCD, etc.
  lcd.clear();                      // Czy?ci ekran.
  tempSensor.begin(12);
}

void loop(void)
{
  switch(tempSensor.isValid())
  {
  case 1:
    lcd.clear();
    lcd.print("Invalid CRC");
    tempSensor.reset();
    return;
  case 2:
    lcd.clear();
    lcd.print("Not a valid device");
    tempSensor.reset();
    return;
  }

  temp = tempSensor.getTemperature();

  lcd.setCursor(0,0);              // Ustawia kursonr na pocz?tku ekranu (Pierwszy wiersz).
  lcd.print("T = ");
  lcd.print(temp);
  lcd.write(0xDF);
  lcd.write('C'); 
  lcd.setCursor(0,1);              // Ustawia kursonr na pocz?tku ekranu (Drugi wiersz).
  lcd.write(',,,,,,,,,,,,,,,'); 
  delay(500);
}

C:\Users\steephan\Documents\Arduino\libraries\DallasTemperature\BSeries.cpp:31:24: error: WConstants.h: No such file or directory

What does this say to you?

WConstants.h was pre Arduino 1.0 I believe - perhaps this is an old version of the library?

My library: 3.6.0
Arduino 1.0.2
I had no problem with others compilations.


I tested more example with Dallas temperature libraries. Each of them was with some compiling problems. I used 3.7.2 libraries.
What am I doing wrong?
It was just copy and paste of each of them. So no mistake during writing.

Example:

In file included from LCD.ino:2:
D:\Programy\Arduino\arduino-1.0.2\libraries\DallasTemperature/DallasTemperature.h:64: error: expected `)' before '*' token
D:\Programy\Arduino\arduino-1.0.2\libraries\DallasTemperature/DallasTemperature.h:222: error: ISO C++ forbids declaration of 'OneWire' with no type
D:\Programy\Arduino\arduino-1.0.2\libraries\DallasTemperature/DallasTemperature.h:222: error: expected ';' before '*' token
LCD:7: error: 'OneWire' does not name a type
LCD:8: error: 'oneWire' was not declared in this scope

After compilatio of example from website: Miles Burton - Innovative engineering for pretty much anything

I founded. It was problem with damge OneWire libraries.

Hey Steephan,

I am having the same issue, which version of onewire fixed your problem?