I want to build a small remote with an ATTiny13 (actually I already have one https://hackaday.io/project/160645-new-remote-for-433mhz-rc-wall-sockets ). My Problem is that the circuit is currently powered with a switch. I want to power the circuit on the press of a button, but at the same time be able to tell which button is pressed. That way I could press a button, my remote sends its signal and as soon as I release the button the circuit powers off again.
If I would connect them all together I wouldnt be able to differentiate what button was pressed, obviously. So I came up with a solution using diodes.
Is there a better way than this? Maybe with less diodes, since I would need six diodes for six buttons?