map

does map() use only analog value or can it use digital value

What do you mean?

map() uses integer values (longs, actually) and returns integer results.

PaulS: map() uses integer values (longs, actually) and returns integer results.

i mean can it use digital value for example a counter thats in the code itself

As long as the values are integers it can use them.

Try it and see.

UKHeliBob:
As long as the values are integers it can use them.

Try it and see.

ok one more thing i have brightness declared in the main loop and analogWrite(…, brightness) in a diffrent voidvoid and its not working why is that /

and its not working why is that

There could be a thousand reasons. Post your code, and we won't need to guess.

Almost certainly because brightness is out of scope in the second function. If only we could see your code ...

Malekhussni:
i have brightness declared in the main loop and analogWrite(…, brightness) in a diffrent voidvoid and its not working

It is as easy as that:
If the code is wrong, it’s not working.

Malekhussni:
why is that /

Why what?
Why you did not post any code?

You know best why you did not post any code!

Most likely you don’t care about code fixes and that’s why you didn’t post the code.

So the answer to your question is: It’s not working because of you are using faulty code!

Diffrent voidvoid. Or whatever.