The difference between digital and analog is that digital tells you a discrete value. Analog makes you interpret the value.
There is no requirement for digital devices to have any electronics in them although it is far easier to do many things if it does.
This ball counter will tell you exactly how many balls have passed with good reliability.
Check this Out