Doing this needs some experimentation on the values we want to have, especially because everyone's definition of It is dark is different. Remember, the longer it takes for the pin to detect the high state, the darker it is.
Close all the tabs except the Main class, where we will be uncommenting the next example to run. Scroll to the main function where we will be commenting the runLcdExample(); and uncomment the runLdrExample(); method. This next method runs the example of how to measure light intensity. When the LDR is connected like in the previous directions, you are able to run the application again by pressing the Run button in the button bar. Take a look at the LCD display where we see different text appearing depending on the light intensity surrounding the LDR.
When there is a lot of light, the display could show information as shown in the following screenshot...