- Sat Nov 11, 2006 5:59 am
#21718
I have to do a calculation which I do with the following source:
This line gives an error:
Thank you in advance!
Code: Select all
int analogPin = 0; // Pressure sensor connected to analog pin 0
long val = 0; // variable to store the read value
void setup()
{
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop()
{
val = analogRead(analogPin); // read the input pin (getting value of around 840-860)
val = ( 1 - ( val/ 1013.25 ) ^ 0.19) ) / 22.558;
Serial.print("Value: ");
Serial.println(val);
delay(1000);
}
This line gives an error:
Code: Select all
The error is:
val = ( 1 - ( val/ 1013.25 ) ^ 0.19) ) / 22.558;
In function 'void loop()':I hope someone can help to solve this. I am totally new to the Arduino.
error: invalid operands of types 'double' and 'double' to binary 'operator^
Thank you in advance!