Each code valid for 12 hours, so yes, if people are connecting at different times they will need a new code.
There are two ways to find the code:
Option 1:
Tap the screen during slideshow and click the “add friend” icon. Frame code will be generated.
Option 2:
Tap screen → Settings → My friends, then tap the add friend icon in the top right corner. Frame code will be generated.