thank you for your help I have a better view of what going on my code and yours both are working
for summerise
when frequency1 reach 4 time it's print 1,2,3,4 and stop print what ever you push remote button
when frequency2 reach -4 time it's print 4,3,2,1,0 and stop print what ever you push remote button