'nbrDevicesHold' does not name a type

Hi Group,
In the code below I have a sub

void I2C_CHECK() {
  nbrDevices = nbrDevicesHold; // get last number of devices found
// do stuff that changes nbrDevices
  nbrDevicesHold = nbrDevices; // On exit save the changed number devices found

But the last code line produces the error mentioned in the subject
As this is a not finnisched project, its attached.

ARDUKSERVO_PCA9685_000.ino (1.51 KB)

Why don’t you simply post ALL of the code?
And ALL of the error messages?

Two hundred and ninety six posts, and you’ve not figured out that we want to see ALL of your code and ALL of your error messages?


nbrDevicesHold = nbrDevices;

Is not in a function


nbrDevicesHold = nbrDevices;

Is not in a function

Thats it, had to move it one row up.
Thanks all

I am glad that it is working now, but how did you ever miss that the code was not in a function, particularly when the error directed you to the exact line that was causing the problem

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.