Loading

Report as inappropriate

Hi,

When compiling the 'Demo 3' code I get the following error:

error: a function-definition is not allowed here before '{' token
void loop() {distancecm=mdistance(); if(distance<5){digitalWrite(lmotorpin1,LOW); digitalWrite(lmotorpin2,HIGH); digitalWrite(rmotorpin1,LOW); digitalWrite(rmotorpin2,HIGH); delay(1000);
^
ROBOTULTRASONIC:32: error: expected '}' at end of input
}
^
exit status 1
a function-definition is not allowed here before '{' token

But there does appear to be a closing bracket where it should be - anyone have any ideas? The code is just copied in, I haven't messed with it at all.

Thanks, and the robot is awesome by the way, great design :)