The code checks the photoresistor if it returns more than 70 percent darkness, it turns the onboard LED on and prints to the serial port. If your photoresistor comes on PCB you do connect it to the signal port directly if not then you need to use a 4.7K ohm pull-up resistor. The following diagrams show different connections.