Concept Help Needed

Start with the first thing you wrote about and get it working. That is: "scan the magazine and count the rounds". Please expand your design for this. Then the other may be a bit easier to do.

Paul