calculation problem, ''expression cannot be used as a function''

We have a problem with our code:

''expression cannot be used as a function''

we want to perform a calculation.
we are beginners with this software, so we would really appreciate your help, thank you!

our code:

int val1;
int Led1 = 2;
int min1 = 167;
int max1 = 980;
int Switch = 8;
int LDR1 = A5;
const float Pi = 3.141593;
float Result;

void setup() {
Serial.begin(9600);
pinMode(Switch, INPUT);
pinMode(LDR1, INPUT);
pinMode(Led1, OUTPUT);

}

void loop() {

//LDR aflezen

if (digitalRead(Switch) == HIGH) {
val1 = analogRead(LDR1);
delay(100);
Result = tan(((Pi/180)((val1-985.38)/-74.155)); // Here is where arduino says it is wrong
Serial.println("de wrijvingscoefficient is: ", Result);

digitalWrite(Led1, HIGH);
delay(1000);
digitalWrite(Led1, LOW);
delay(150);
exit(0);
}

};

You have 1 too many opening brackets, try:

 Result = tan((Pi/180)((val1-985.38)/-74.155));
 Result = tan(((Pi/180)((val1-985.38)/-74.155));

You're missing a multiplication operator.

(and code tags)

Thanks for the quick repllies, we now got a new error, saying:
"exit status 1
call of overloaded 'println(const char [29], float&)' is ambiguous"

Our updated code:

int val1;
int Led1 = 2;
int min1 = 167;
int max1 = 980;
int Switch = 8;
int LDR1 = A5;
const float Pi = 3.141593;

void setup() {
Serial.begin(9600);
pinMode(Switch, INPUT);
pinMode(LDR1, INPUT);
pinMode(Led1, OUTPUT);

}

void loop() {

//LDR aflezen

if (digitalRead(Switch) == HIGH) {
val1 = analogRead(LDR1);
delay(100);
float Result = tan((Pi/180)*((val1-985.38)/-74.155));
Serial.println("de wrijvingscoefficient is: ", Result);

digitalWrite(Led1, HIGH);
delay(1000);
digitalWrite(Led1, LOW);
delay(150);
exit(0);
}

};

Serial.print ("de wrijvingscoefficient is: ")
Serial.println(Result);

And you're still missing code tags.

Thank you!!!
It works

thanks for the quick replies

i have a simular problem we're trying to make a flood alert but we dont know what to put as if xxxx>100
#include <LiquidCrystal.h>
// 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 analogOutPin = 9; // Analog output pin that the LED is attached to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int Buzzer = 9;
int Led = 10;
int Ledred= 8;
int Ledgreen = 7;
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
int tones[] = {261, 277, 293, 311, 329, 349, 369, 392, 415, 440, 466, 493, 523 ,554};
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// You can add more tones but i added 14. Just fill in what tone you would like to use, @ void loop you see " tone(Buzzer, tones[12]); " below, digitalWrite(Buzzer, HIGH);
// here you can change the tones by filling in a number between 1 and 14

void setup() {
lcd.begin(16, 2);
pinMode (Buzzer, OUTPUT);
pinMode (Led, OUTPUT);
pinMode (Ledred, OUTPUT);
pinMode (Ledgreen, OUTPUT);
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}

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

// print the results to the Serial Monitor:
Serial.print("sensor = ");
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
if (sensorValue >= 100()){
digitalWrite(Ledred, HIGH);
digitalWrite(Ledgreen, LOW);
digitalWrite(Led, HIGH);
digitalWrite(Buzzer, HIGH);
tone(Buzzer, tones[6]);
delay(200);
digitalWrite(Led, LOW);
digitalWrite(Buzzer, LOW);
noTone(Buzzer);
delay(200);
digitalWrite(Led, HIGH);
digitalWrite(Buzzer, HIGH);
tone(Buzzer, tones[14]);
delay(200);
digitalWrite(Led, LOW);
digitalWrite(Buzzer, LOW);
noTone(Buzzer);
delay(200);
}
else
{
digitalWrite(Led, LOW);
digitalWrite(Buzzer, LOW);
digitalWrite(Ledred, LOW);
digitalWrite(Ledgreen, HIGH);
}

}

}

// wait 2 milliseconds before the next loop for the analog-to-digital
// converter to settle after the last reading:
delay(500);
}

if (sensorValue >= 100()){ Why does that look so wrong?

Please remember to use code tags when posting code.

(And why did you necro-hijack a three year old thread?)