How to display it at 0.1 second

i use this command currentMillis - previousMillis = 100 ; but the program is not do this command.

i use this command currentMillis - previousMillis = 100 ; but the program is not do this command.

That's not at all surprising because that's not valid code.

Please take some time to read these pages:

What you posted is not a valid command. Study this in the IDE: file/examples/digital/blink without delay.

Also important - 'How to Use This Forum' - pinned at the top of the topic.

And, the ever popular code tags;

Common error.
"=" is assignment.
"==" is for comparisons.

It is a guessing game when I have to work from snippets, but you probably want:

if (currentMillis - previousMillis == 100) {
// do something
}

@OP: Greater than or equal would be preferred over equal.

vaj4088:
Common error.
"=" is assignment.
"==" is for comparisons.

It is a guessing game when I have to work from snippets, but you probably want:

if (currentMillis - previousMillis == 100) {

// do something
}

I've done like this already and it not different for previously.
Do you have any other ideas for writing code? Keep value every 0.1 seconds.

Please read the first post in this forum.

@methas13842, do not cross-post. Threads merged.

I've done like this already and it not different for previously.

Let's see your complete program

Have you by any chance got a semicolon on the end of the if test ?

sterretje is correct. I was trying to highlight the difference between assignment and comparison, but better code is probably

if (currentMillis - previousMillis >= 100) {
// do something
}

Of course, this is all guesswork until the OP properly posts the real code.

The reason that this is better code is that micros() and millis() are not guaranteed to take single steps, and in fact on most (all?) Arduinos, these functions are confirmed to take bigger steps (either occasionally or always).