int sensorPin =0; // pin the sensor is connected to
int ledPin = 9; // led is connected to pin 9
void setup()
{
pinMode(ledPin, OUTPUT); // setting ledPin as an output
// Serial.begin(9600);
}
void loop()
{
//Serial.println(analogRead(sensorPin));
int val = analogRead(sensorPin); // val is the analog read of the sensor
val = constrain(val, 20, 90);
int ledLevel = map (val 20, 90, 255, 0);
analogWrite(ledPin, ledLevel);
}
for some reason i keep getting the messege "expected ')' before numeric constant" but i dont understand what is wrong with code. any corrections would be appreciated