Sous Vide Controller: Issue with Code/Dallas Temperature Lib

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
GratefulDread
 
Posts: 3
Joined: Mon Dec 29, 2014 1:01 am

Sous Vide Controller: Issue with Code/Dallas Temperature Lib

Post by GratefulDread »

Greetings,

I recently purchased the Adafruit Sous Vide kit http://www.adafruit.com/products/1401. I have built the hardware but have been unable to get the code (I am using the code from the Adafruit website) to compile as there are errors with the commands for the temperature controller. I have gotten the fewest errors using an older version of the Dallas Temperature Control Library (TLC 3.6.0) from http://www.milesburton.com/?title=Dalla ... .2FLibrary. With this library, I still get the errors:

PID_Controller.ino: In function 'void setup()':
PID_Controller:172: error: 'class DallasTemperature' has no member named 'setWaitForConversion'
PID_Controller.ino: In function 'void DoControl()':
PID_Controller:565: error: 'class DallasTemperature' has no member named 'isConversionAvailable'

Is there a certain version of this library that I should be using? Any modifications I should make to the code?

Thank you for your time!

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by adafruit_support_bill »

The code for the tutorial was compiled with the latest version which is 3.7.2 and is available here: http://www.milesburton.com/?title=Dalla ... ary#Github

User avatar
GratefulDread
 
Posts: 3
Joined: Mon Dec 29, 2014 1:01 am

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by GratefulDread »

adafruit_support_bill wrote:The code for the tutorial was compiled with the latest version which is 3.7.2 and is available here: http://www.milesburton.com/?title=Dalla ... ary#Github
If I use the most recent version of the library (3.7.2), I get even more errors when I try to compile the code. I am using the most recent version of the OneWire library (version 2.2) but is this possibly the incorrect version?

C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:85:24: error: WConstants.h: No such file or directory
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp: In constructor 'OneWire::OneWire(uint8_t)':
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:93: error: 'digitalPinToBitMask' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:94: error: 'digitalPinToPort' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:94: error: 'portInputRegister' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp: In member function 'uint8_t OneWire::reset()':
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:127: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:134: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp: In member function 'void OneWire::write_bit(uint8_t)':
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:157: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:165: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp: In member function 'uint8_t OneWire::read_bit()':
C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:185: error: 'delayMicroseconds' was not declared in this scope

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by adafruit_support_mike »

That's an IDE version issue.

The Arduino IDE is built on top of the Wiring project, which is a more general system for making computers talk to programmable hardware. When the Arduino team decided to build their own version just for Arduino hardware, they moved some of the information around.

What you need to do is replace this line:

Code: Select all

#include "WConstants.h" 
With this:

Code: Select all

#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

User avatar
GratefulDread
 
Posts: 3
Joined: Mon Dec 29, 2014 1:01 am

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by GratefulDread »

adafruit_support_mike wrote:That's an IDE version issue.

The Arduino IDE is built on top of the Wiring project, which is a more general system for making computers talk to programmable hardware. When the Arduino team decided to build their own version just for Arduino hardware, they moved some of the information around.

What you need to do is replace this line:

Code: Select all

#include "WConstants.h" 
With this:

Code: Select all

#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif
Cool, thanks! Unfortunately, the line:

Code: Select all

#include "WConstants.h" 
doesn't appear in the program. I tried adding the new block of code at the beginning of the sketch where libraries are added and am getting a similar error.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by adafruit_support_mike »

You need to modify the OneWire library reported in the error messages:

Code: Select all

C:\Users\Barry\Documents\Arduino\libraries\OneWire\OneWire.cpp:85:24: error: WConstants.h: No such file or directory

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by Franklin97355 »

Make sure this code is in the DallasTemperature.cpp file and tell us which version of the IDE you are using.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by adafruit_support_bill »

You must be using a pretty old version of the OneWire library.
Try this one: http://www.pjrc.com/teensy/td_libs_OneWire.html

ed1960
 
Posts: 15
Joined: Mon Dec 12, 2011 6:36 pm

Re: Sous Vide Controller: Issue with Code/Dallas Temperature

Post by ed1960 »

Well the newest OneWire library had something similar if you use it on an attiny platform... depending on what core you use.
I remedied that by adding code to the newest OneWire.h, kind of akin to what is described above

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”