error message confusion

Hi all, I had Arduino IDE running on my netbook, but changed OS to Ubuntu. So I have reinstalled the Arduino IDE as per the instructions here - http://www.pluggy.me.uk/arduino-ubuntu/

Then I went through and reinstalled the libraries I was using, and finally tried to compile my (previously working) code.

It is not working. So I figured I would run some example code from each of the libraries to check each one works. So the first one is the MAX6675 library from http://ryanjmclaughlin.com/

When I run the example code from this I get the error message :- conflicting declaration 'int SCK' The rest of the error message is as follows:-

In file included from RBBB_PID_v1_1.cpp:4: /home/ross/Arduino/arduino-1.0/libraries/max6675/max6675.h:11:22: error: WProgram.h: No such file or directory In file included from RBBB_PID_v1_1.cpp:5: /home/ross/Arduino/arduino-1.0/libraries/MenuBackend/MenuBackend.h:195: error: stray ‘\342’ in program /home/ross/Arduino/arduino-1.0/libraries/MenuBackend/MenuBackend.h:195: error: stray ‘\200’ in program /home/ross/Arduino/arduino-1.0/libraries/MenuBackend/MenuBackend.h:195: error: stray ‘\250’ in program RBBB_PID_v1_1.cpp:6:20: error: PID_v1.h: No such file or directory In file included from RBBB_PID_v1_1.cpp:3: /home/ross/Arduino/arduino-1.0/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.h:80: error: conflicting return type specified for ‘virtual void LiquidCrystal_I2C::write(uint8_t)’ /home/ross/Arduino/arduino-1.0/hardware/arduino/cores/arduino/Print.h:48: error: overriding ‘virtual size_t Print::write(uint8_t)’ RBBB_PID_v1_1:10: error: conflicting declaration ‘int SCK’ /home/ross/Arduino/arduino-1.0/hardware/arduino/variants/standard/pins_arduino.h:43: error: ‘SCK’ has a previous declaration as ‘const uint8_t SCK’ RBBB_PID_v1_1:16: error: no matching function for call to ‘MAX6675::MAX6675(int&, int&, const uint8_t&, int&, float&)’ /home/ross/Arduino/arduino-1.0/libraries/max6675/max6675.h:16: note: candidates are: MAX6675::MAX6675(int, int, int, int) /home/ross/Arduino/arduino-1.0/libraries/max6675/max6675.h:14: note: MAX6675::MAX6675(const MAX6675&) RBBB_PID_v1_1:31: error: ‘PID’ does not name a type RBBB_PID_v1_1.cpp: In function ‘void setup()’: RBBB_PID_v1_1:148: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:150: error: ‘AUTOMATIC’ was not declared in this scope RBBB_PID_v1_1.cpp: In function ‘void loop()’: RBBB_PID_v1_1:172: error: no matching function for call to ‘MAX6675::read_temp(int)’ /home/ross/Arduino/arduino-1.0/libraries/max6675/max6675.h:17: note: candidates are: float MAX6675::read_temp() RBBB_PID_v1_1:184: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1.cpp: In function ‘void menuChanged(MenuChangeEvent)’: RBBB_PID_v1_1:223: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:237: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:250: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:334: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:340: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:346: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:352: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:358: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:364: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:370: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:376: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:382: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:387: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:394: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:401: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:408: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:415: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:422: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:429: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:436: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:443: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:450: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:457: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:465: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:473: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:480: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:487: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:494: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:501: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:508: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:515: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:522: error: ‘myPID’ was not declared in this scope RBBB_PID_v1_1:530: error: ‘myPID’ was not declared in this scope

Any suggestions?

That library needs updating for Arduino IDE 1.0. You have a number of options.

  1. Go back to Arduino IDE 0022.
  2. Get an updated library, if available.
  3. Update the library yourself.
  • The WProgram.h file, which provides declarations for the Arduino API, has been renamed to Arduino.h. To create a library that will work in both Arduino 0022 and Arduino 1.0, you can use an #ifdef that checks for the ARDUINO constant, which was 22 and is now 100. For example:

if defined(ARDUINO) && ARDUINO >= 100

include "Arduino.h"

else

include "WProgram.h"

endif

WProgram.h: No such file or directory

is the clue The WProgram.h file, which provides declarations for the Arduino API, has been renamed to Arduino.h. http://arduino.cc/en/Main/ReleaseNotes.

Thanks for your advice, I have now changed to Arduino 0022.

I am now having some difficulty getting my I2C LCD to work. I started with just adafruit’s max6675 library, got that working happily, but I can only send serial data to the terminal, I2C turns on the lcd screen for 3 sec, then it flashes about once a second.
Here is my code, any pointers?

// this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "max6675.h"

int thermoDO = 11;
int thermoCS = 10;
int thermoCLK = 12;

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display

  
void setup() {
  Serial.begin(9600);
  lcd.init(); // initialize the lcd 
  lcd.backlight(); 
  lcd.setCursor(0,0);
  lcd.print("Arduino PID");
  lcd.setCursor(2,1); //Initial splash screen
  lcd.print("for espresso" );
  delay(3000);
  lcd.clear();  
  lcd.print("MAX6675 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
  
   lcd.setCursor(0,0);
   lcd.print("C = "); 
   lcd.print(thermocouple.readCelsius());
   lcd.setCursor(0,0);
   lcd.print("F = ");
   lcd.print(thermocouple.readFarenheit());
 
   delay(1000);
}

Figured it out, when 0022 was complaining about no wire.h library, as I seemed to recall wire.h being a standard library. I tried 0018 & that fixed the problem.