Often error messages can be cryptic. Here this is not the case. This error message is crystal clear.
Duplicate local variable means two local variables have the same name.
Example
- void draw() {
- int a = 0; // variable a
- int a = 0; // duplicate local variable a // solution: rename to b or use the existing a
- }
In fact the error message even gives you the name of this variable (in the example: a).
The solution is to either rename your second (duplicate) variable to something else (like in the example: b) or keep using the existing variable a (by not declaring it again, i.e. lose the second int in this example).