Go Down

Topic: Getting an "initializer provided for function" in my code thats confusing me (Read 86 times) previous topic - next topic

kotalee

Hi guys, I keep receiving this "initializer provided for function"

here is my code -- it highlights in red the start where " void setup()
                                                                                (
Im using this code for an IR Tripwire
Can someone maybe give me some details as to why this might be happening

int firstsens = 4;
int secondsens = 5;
unsigned long time, time2;
float fps, elap;
int val;
int val2;

void setup()
(
Serial.begin(9600);
pinMode (firstsens, INPUT);
pinmode (secondsens, INPUT);
)
void loop()
(
Serial.printIn("Waiting for projectile...");
val = analogRead(firstsens);
val2 = analogRead(secondsens);
while (val > 30)
(
    val = analogRead(firstsens); 
)
while (val <= 30)
(
time = micros();
val = analogRead
)

while (val2 > 30)
(
time2 = micros();
val2 = analogRead(secondsens);
)
elap = time2 - time;

fps = 333333/elap;
Serial.printIn(fps );
)


el_supremo

You need to learn the difference between () and {} in C/C++.

Pete
Don't send me technical questions via Private Message.

PaulMurrayCbr

http://paulmurraycbr.github.io/ArduinoTheOOWay.html

Go Up