<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 PMOD ALS Sensor demonstration
This demonstration shows how to use the PmodALS. You will also see how to plot a graph using matplotlib.
The PmodALS and a light source is required. E.g. cell phone flashlight.
The ambient light sensor is initialized and set to log a reading every 1 second.  The sensor can be covered to reduce the light reading, and a light source can be used to increase the light reading
1. Use ALS read() to read the current room light
Step1:  2. Starting logging light once every second
Step2:  3. Modifying the light
Decrease the light reading by covering the sensor
Increase the light by shining a flashlight on the device
Stop the logging whenever you are finished trying to change the sensor's value.
Step3:  4. Plot values over time
<ASSISTANT_TASK:>
Python Code:
from pynq.overlays.base import BaseOverlay
base = BaseOverlay("base.bit")
from pynq.lib import Pmod_ALS
# ALS sensor is on PMODB
my_als = Pmod_ALS(base.PMODB)
my_als.read()
Explanation: PMOD ALS Sensor demonstration
This demonstration shows how to use the PmodALS. You will also see how to plot a graph using matplotlib.
The PmodALS and a light source is required. E.g. cell phone flashlight.
The ambient light sensor is initialized and set to log a reading every 1 second.  The sensor can be covered to reduce the light reading, and a light source can be used to increase the light reading
1. Use ALS read() to read the current room light
End of explanation
my_als.start_log()
Explanation: 2. Starting logging light once every second
End of explanation
my_als.stop_log()
log = my_als.get_log()
Explanation: 3. Modifying the light
Decrease the light reading by covering the sensor
Increase the light by shining a flashlight on the device
Stop the logging whenever you are finished trying to change the sensor's value.
End of explanation
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot(range(len(log)), log, 'ro')
plt.title('ALS Sensor log')
plt.axis([0, len(log), min(log), max(log)])
plt.show()
Explanation: 4. Plot values over time
End of explanation
<END_TASK>