I often come across battery powered items that store their state when switched off, particularly 'simple' items like LED bicycle lights (e.g. flash or solid light, changing each time it is switched on).
How is this usually done? Do they charge a capacitor or capacitors when on to store a few bits of 'memory', or use a small amount of battery power to remember the state in a flip-flop, or store charge on the gate of a FET?
I'm very familiar with more complex items storing data in EEPROM, FLASH etc, but guess there is a common alternative for simple/cheap battery powered products.
This is a little bit like another question, but it is asking about shorter term storage, my bicycle light 'remembers' its state for at least a couple of weeks (after that, it's me who can't remember!) and battery life when off is much more than a year.