Some resources to help you getting started with STM32 programming.
A photoresistor or light-dependent resistor (LDR) or photocell is a resistor whose resistance decreases with increasing incident light intensity; in other words, it exhibits photoconductivity.
A photoresistor is made of a high resistance semiconductor. If light falling on the device is of high enough frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. The resulting free electron (and its hole partner) conduct electricity, thereby lowering resistance.