One led for 18 buttons

Sounds like you could benefit from a code review. Post it here and the forum can suggest ways to improve it.

But you said

?