How to call a function from an if statement

I have written some large number routines for a 20 x 4 LCD, and they work great.

I want to be able to call the various number displays based on a count value, or any other code that would use the large number display.
Here is an abbreviated snippit of code - the function is called regardless of the value (val)

 val = 0;

if( val = 1)

{  one();  }


lcd.print("Here is number ONE");
 delay(1000);
 lcd.clear();
 delay (500);
} / /   this is the end of the loop

void one()
{

  int val = 0;
  lcd.setCursor(0,0);  
lcd.write(0);
lcd.setCursor(1,0);

The print statement is always displayed correctly, but the number display shows up regardless

Probably something simple, but I cannot figure it out

Rather than:

if( val = 1)

try:

if( val == 1)

That solves the problem, actually I just discovered that on my own :slight_smile:

Thanks