Offline
Newbie
Karma: 1
Posts: 14
|
 |
« on: February 08, 2013, 07:27:48 am » |
I want to download MAX6675 library.But I'm getting the following error:
In file included from Single_Temp.pde:6: C:\Users\salim\Documents\Arduino\libraries\max6675arduinolibrary/MAX6675.h:9:22: error: WProgram.h: No such file or directory Single_Temp.pde:21:4: error: #else without #if Single_Temp.pde:23:4: error: #endif without #if Single_Temp:11: error: conflicting declaration 'int SCK' C:\Program Files\arduino-1.0.3\hardware\arduino\variants\mega/pins_arduino.h:38: error: 'SCK' has a previous declaration as 'const uint8_t SCK' Single_Temp:19: error: 'CS0' was not declared in this scope
How I can fix this problem?
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #1 on: February 08, 2013, 07:46:17 am » |
You have to go into the .h and .cpp files and change "WProgram.h" to Arduino.h
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #2 on: February 08, 2013, 08:01:54 am » |
I tried, but nothing can be changed
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #3 on: February 08, 2013, 08:07:03 am » |
I tried, but nothing can be changed Then you didn't try hard enough, sorry to say. Do you have Notepad or some rendition of it? Try to download Notepad++ notepad-plus-plus.org/Once you have notepad, go to your library folder, find the library your using and open the .h and .cpp file in notepad.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #4 on: February 08, 2013, 09:45:29 am » |
I've tried everything.Please help the library users
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #5 on: February 08, 2013, 10:06:35 am » |
Were you able to open the .h and .cpp files? Did you change the WProgram.h to Arduino.h? Did you save the files and reset the program?
What exactly did you do, when you say everything? Maybe attach the two codes below, so I can see what you have done.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #6 on: February 08, 2013, 10:43:35 am » |
i fixed this problem but This time I'm getting the following error: Single_Temp:19: error: 'MAX6675' does not name a type Single_Temp.pde: In function 'void loop()': Single_Temp:31: error: 'temp0' was not declared in this scope .cpp file: /* MAX6675.cpp - Library for reading temperature from a MAX6675. Created by Ryan McLaughlin <ryanjmclaughlin@gmail.com> */
#include <Arduino.h> #include <MAX6675.h>
MAX6675::MAX6675(int CS_pin, int SO_pin, int SCK_pin, int units, float error) { pinMode(CS_pin, OUTPUT); pinMode(SO_pin, INPUT); pinMode(SCK_pin, OUTPUT); digitalWrite(CS_pin, HIGH); _CS_pin = CS_pin; _SO_pin = SO_pin; _SCK_pin = SCK_pin; _units = units; _error = error; }
float MAX6675::read_temp(int samples) { int value = 0; int error_tc = 0; float temp = 0; for (int i=samples; i>0; i--){
digitalWrite(_CS_pin,LOW); // Enable device
/* Cycle the clock for dummy bit 15 */ digitalWrite(_SCK_pin,HIGH); digitalWrite(_SCK_pin,LOW);
/* Read bits 14-3 from MAX6675 for the Temp Loop for each bit reading the value and storing the final value in 'temp' */ for (int i=11; i>=0; i--){ digitalWrite(_SCK_pin,HIGH); // Set Clock to HIGH value += digitalRead(_SO_pin) << i; // Read data and add it to our variable digitalWrite(_SCK_pin,LOW); // Set Clock to LOW } /* Read the TC Input inp to check for TC Errors */ digitalWrite(_SCK_pin,HIGH); // Set Clock to HIGH error_tc = digitalRead(_SO_pin); // Read data digitalWrite(_SCK_pin,LOW); // Set Clock to LOW digitalWrite(_CS_pin, HIGH); //Disable Device } value = value/samples; // Divide the value by the number of samples to get the average /* Keep in mind that the temp that was just read is on the digital scale from 0ËšC to 1023.75ËšC at a resolution of 2^12. We now need to convert to an actual readable temperature (this drove me nuts until I figured this out!). Now multiply by 0.25. I tried to avoid float math but it is tough to do a good conversion to ËšF. THe final value is converted to an int and returned at x10 power. */ value = value + _error; // Insert the calibration error value if(_units == 0) { // Request temp in ËšF temp = ((value*0.25) * (9.0/5.0)) + 32.0; // Convert value to ËšF (ensure proper floats!) } else if(_units == 1) { // Request temp in ËšC temp = (value*0.25); // Multiply the value by 0.25 to get temp in ËšC } /* Output -1 if there is a TC error, otherwise return 'temp' */ if(error_tc != 0) { return -1; } else { return temp; } }
thanks for your helps... Moderator edit: [code] ... [/code] tags added. (Nick Gammon)
|
|
|
|
« Last Edit: February 08, 2013, 04:49:42 pm by Nick Gammon »
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1563
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #7 on: February 08, 2013, 10:46:42 am » |
Where is your sketch?
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19053
I don't think you connected the grounds, Dave.
|
 |
« Reply #8 on: February 08, 2013, 10:47:10 am » |
In MAX6675.h, I changed "WProgram.h" to "Arduino.h" In MAX6675.cpp, I changed "WProgram.h" to "Arduino.h" (or you can delete the #include completely) In the "read_temp" example, I changed int SCKpin = 13; // SCK pin of MAX6675 int units = 2; // Units to readout temp (0 = raw, 1 = ˚C, 2 = ˚F) float temperature = 0.0; // Temperature output variable
// Initialize the MAX6675 Library for our chip MAX6675 temp(CS,SO,SCKpin,units);
and I got the error message Binary sketch size: 5264 bytes (of a 14336 byte maximum) (Compiling on 1.0 for a 2009) OP, please use code tags when posting code.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #9 on: February 08, 2013, 11:03:58 am » |
i'm sorry awol. I didn't know. Can we solve this problem?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19053
I don't think you connected the grounds, Dave.
|
 |
« Reply #10 on: February 08, 2013, 11:05:06 am » |
Yes, I just told you in the PM, we can solve this problem. But only when you post your sketch in code tags on the forum, plus the exact error message you're getting. I don't do PM help-desk.
|
|
|
|
« Last Edit: February 08, 2013, 11:08:10 am by AWOL »
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #11 on: February 08, 2013, 04:10:11 pm » |
Hi,
I want to use max6675 library but ı have compile error. this error:
In file included from Single_Temp.ino:6: C:\Users\f\Documents\Arduino\libraries\max66library/MAX6675.h:9:22: error: WProgram.h: No such file or directory
Can you help me?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #12 on: February 08, 2013, 04:27:54 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #13 on: February 08, 2013, 04:31:02 pm » |
Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.
Threads merged.
- Moderator
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 137
Posts: 19053
I don't think you connected the grounds, Dave.
|
 |
« Reply #14 on: February 08, 2013, 04:32:35 pm » |
Please read reply #8
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|