calling a function from main loop using push button code

Alaxwora:
you are right but i used to ask experienced people before doing any thing to avoid making mistakes that's all specially for beginners like me

The Arduino system is great for learning-by-doing and often you can figure things out yourself faster than by asking questions here.

By the way I am NOT trying to discourage you from asking questions.

...R