I recently revisited some old projects after watching Ben Eater’s
great video explaining SR latch behaviour.
First, I breadboarded a Set-Reset Latch with BJTs in
LEAP#061,
tested it with an Arduino in
LEAP#062,
then later built a Set-Reset Latch with NAND gates in
LEAP#077.
As always, all notes, schematics and code are in the Little Electronics & Arduino Projects repo on GitHub