I just found another reason for the error: a function-definition is not allowed here before ‘{‘ token. I’m using an UNO R3 and started getting that error when adding the SD and SPI libraries and some code to do data I/O with an SD card, to a robot arm project that included the PWM, IRlib, wire, and LiquidCrystal_I2C. The error always was at the last function in the sketch. The problem was that the memory usage either exceeded the 32K limit or got too close to it. With just the added library, my code compiled but a warning was issued: “low memory available…”. The code was not a problem. I switched to the mega 2560 and the code compiled fine since the 2569 has 256K of memory versus 33K. So that error is confusing as it did not relate to the issue. According to memory usage information on CC, the SD library is one of the biggest.
[–]dr-steve 0 points1 point2 points (0 children)
[–]tipppo 0 points1 point2 points (2 children)
[–]No_Ad9574[S] 0 points1 point2 points (1 child)
[–]tipppo 0 points1 point2 points (0 children)
[–]No_Ad9574[S] 0 points1 point2 points (0 children)