Error in Code when compiling

Hi,

I am having an error in my code and cannot seem to find the problem.

When I compile the following code I get an error "break statement not in loop or statement".....

if (fingerprint_flag == 1)
{
finger.fingerID = 0;
delay(50);
setup_f();
loop_f();
display.clearDisplay();
display.drawBitmap(0, 0, logo_bmp, LOGO_WIDTH, LOGO_HEIGHT, 1);
display.display();
customKey = customKeypad.getKey();
if (customKey == 'C' || customKey == 'A')
break;
delay(1000);
}

Thank you in advance.

Last edited on
https://en.cppreference.com/w/cpp/language/break

> if (fingerprint_flag == 1)
An if statement is not a loop.
Thank you for reply,
Should if be removed than?
I've no idea - it's your code.

Nor have you posted enough context around the snippet to begin to guess what you ultimately want.

I guess the first question you need to ask is, where does the code need to go when 'C' or 'A' is pressed.

Thank you for your reply Salem,

May I email you my full code for you to look at? I don't mind paying you for your guidance and time.

Rgds Firdosh

Topic archived. No new replies allowed.