trouble with new version 1.0

My program will not compile using the new version 1.0. It throws up an error on the analog pin declaration. To check I tried to compile the example AnalogInput program provided with the download. This throws up the same error also:
" 'A0' was not declared in this scope". Any suggestions?

Capture.JPG

It would be helpful if you posted the actual code causing problems (along with the errors.) Either by themselves isn't very telling.

Thank you for posting a reply. Code that also causes the problem is actually included with the Arduino 1.0 download under File / Examples / Analog / AnalogInput

scrodulartum: what board (and board selection from the Tools menu) are you using? In Arduino 1.0, the boards.txt files (for third-party hardware) need an extra parameter (the variant) which points to a header file that contains board specific definitions like A0, etc.

Hi Mellis. My board is a genuine Arduino Uno, and this is selected in the Tools / Board menu.

My code and the AnalogInput code example included in the download both compiled just fine under the previous release. Both have trouble with the analog pin A0 input with the new code.

Do you think that my version 1.0 download might be corrupted? Am I alone with this problem, I wonder. Has anybody else tried to compile the AnlaogInput example using the new version 1.0?

The A0 constants and examples should work fine in Arduino 1.0. I've certainly used them a bunch.

Can you enable verbose output during compilation (in the preferences dialog) and post the full text of the messages you get when trying to compile? That might help us figure out what's going on.

Thanks, Mellis. I've just opened the AnalogInput example included, and run the Verify over it. Here is the verbose output. I couldn't find a way to copy the verbose output directly to the clipboard - only the code itself would copy (and that is included with the program). So I've attached a .jpg copy...I hope it's readable.

To check I tried to compile the example AnalogInput program provided with the download. This throws up the same error also:
" 'A0' was not declared in this scope". Any suggestions?

The below from the 1.0 examples compiles just fine with my old arduino. Do you have the uno selected in the IDE?

/*
  Analog Input
 Demonstrates analog input by reading an analog sensor on analog pin 0 and
 turning on and off a light emitting diode(LED)  connected to digital pin 13. 
 The amount of time the LED will be on and off depends on
 the value obtained by analogRead(). 
 
  http://arduino.cc/en/Tutorial/AnalogInput
 
 */

int sensorPin = A0;    // select the input pin for the potentiometer
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(ledPin, OUTPUT);  
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);    
  // turn the ledPin on
  digitalWrite(ledPin, HIGH);  
  // stop the program for <sensorValue> milliseconds:
  delay(sensorValue);          
  // turn the ledPin off:        
  digitalWrite(ledPin, LOW);   
  // stop the program for for <sensorValue> milliseconds:
  delay(sensorValue);                  
}

I am new to the Arduino but have been running several programs without problems until I loaded 1.0
I downloaded and installed version 1.0 and I am seeing the same problem with A0. I have an additional error that I think may be causing the problem, Arduino.h File or directory not found. How do I tell the compiler where to find this file?

Below are the errors that I got from a program that in earlier versions compile without errors.
ARDUINO 1.0 Error Compilling
Meas_if_greater_then_12_5_volts.cpp:17:23: error: Arduino.h: No such file or directory
Meas_if_greater_then_12_5_volts.pde:-1: error: 'A0' was not declared in this scope
Meas_if_greater_then_12_5_volts.cpp: In function 'void setup()':
Meas_if_greater_then_12_5_volts.pde:-1: error: 'Serial' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'OUTPUT' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'pinMode' was not declared in this scope
Meas_if_greater_then_12_5_volts.cpp: In function 'void loop()':
Meas_if_greater_then_12_5_volts.pde:-1: error: 'analogRead' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'map' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'Serial' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'BYTE' was not declared in this scope

As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.

Meas_if_greater_then_12_5_volts.pde:-1: error: 'delay' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'HIGH' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'digitalWrite' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'LOW' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'LOW' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'digitalWrite' was not declared in this scope
Meas_if_greater_then_12_5_volts.pde:-1: error: 'HIGH' was not declared in this scope

Any assistance would be greatly appreciated.

Here is the full program below


// These constants won't change. They're used to give names
// to the pins used:
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int Grnled1 = 8;
const int Redled2 = 9;
const int Grnled3 = 10;
int Instr = 254;
int CLR = 1;
int sensorValue = 0; // value read from the pot
float outputValue = 0; // value output to the PWM (analog out)
int startpos = 128; // upper left displat pos
int line2 = 192; // line 2 start pos

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
// initialize pin 8,9 & 10 as outputs
pinMode(Grnled1, OUTPUT);
pinMode(Redled2, OUTPUT);
pinMode(Grnled3, OUTPUT);

}

void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
float outputValue = map(sensorValue, 0, 1023, 0, 255);

// the 3 in the below formular is the multiplier for the resistor bridge combination (2K & 1K)
// This reduces the outputValue by 1/3 so that 15 volts will look like 5 volts. And that why it needs
// to be multiplied by 3 before it is sent to the display.
// Added + .5 below to fix measure error
float Voltage = (((5 * outputValue)/255)*3)+.5;

// print the results to the serial monitor:
Serial.print(Instr, BYTE); //Instruction coming
Serial.print(CLR, BYTE); // Clear display
delay(10);
Serial.print(Instr, BYTE); //Instruction coming
Serial.print(startpos, BYTE); // move to upper left line

if (Voltage >= 12.5) {
Serial.print("Voltage >= 12.5");
digitalWrite(Grnled1, HIGH);
digitalWrite(Redled2, LOW);
goto goaround;
}

Serial.print("sensor = " );
Serial.print(sensorValue);
digitalWrite(Grnled1, LOW);
digitalWrite(Redled2, HIGH);

goaround:
Serial.print(Instr, BYTE); //Instruction coming
Serial.print(line2, BYTE); // move to begining of line 2

Serial.print("Volt = ");
Serial.print(Voltage);

delay(50);
}

I was able to solve the above problem (Arduino.h File or directory not found) by going to the Files Preferences and change the directory location. Thanks everyone for your help.

mrbill731:
I was able to solve the above problem (Arduino.h File or directory not found) by going to the Files Preferences and change the directory location. Thanks everyone for your help.

Yeah, as JerryJonz said here.
But I wouldn't say that is the solution. That one in Preferences is sketches folder, not Arduino folder.

I managed to solve this problem by removing all traces of the Arduino download from my computer, and then re-downloading. I guess there must have been some corruption in one of the files...
Thanks to everybody who offered help and advice for this problem