Nice to see you added a capacitor. If you wanted to do an equivalent of the opto, but in mosfets, then you'd need a p-chan and an n-chan. The devil is in the details, so you'd have to analyse the circuit to see if there is any specific advantage in switching the resistor divider. There has probably been discussion on the likes of stack exchange as this is not a new problem. Low power circuitry is tricky as you need to analyse just about every component for the likes of leakage and temperature sensitivity.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Nice to see you added a capacitor. If you wanted to do an equivalent of the opto, but in mosfets, then you'd need a p-chan and an n-chan. The devil is in the details, so you'd have to analyse the circuit to see if there is any specific advantage in switching the resistor divider. There has probably been discussion on the likes of stack exchange as this is not a new problem. Low power circuitry is tricky as you need to analyse just about every component for the likes of leakage and temperature sensitivity.