Triggering Python program using an Arduino - spectrometer

Why not connect the photodiode to an input on the Nucleo, to make a self-contained system?