I want to make a can counter

This is not a free coding service, you need to do the coding your self and we will help you with your problems. There is a book called Arduino Cookbook, get a copy and read, it will answer most of your questions.