<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Using Peripherals with the Base overlay
Base overlay
The PYNQ-Z1 has 2 Pmod connectors. PMODA and PMODB as indicated below are connected to the FPGA fabric. 
Using Pmods with an overlay
To use a peripheral two software components are required; a driver application written in C for the IOP, and a Python module. These components are provided as part of the Pynq package for supported peripherals. See the IO Processors
Step1:  Try writing a message to the OLED.
Step2:  Import the ALS library, create an instance of the ALS Pmod, and read the value from the sensor.
Step3:  Write the value from the ALS to the OLED. The ALS sensor returns an 8-bit value. 
0 
<ASSISTANT_TASK:>
Python Code:
from pynq import Overlay
from pynq.iop import Pmod_OLED
from pynq.iop import PMODB
ol = Overlay("base.bit")
ol.download()
oled = Pmod_OLED(PMODB)
Explanation: Using Peripherals with the Base overlay
Base overlay
The PYNQ-Z1 has 2 Pmod connectors. PMODA and PMODB as indicated below are connected to the FPGA fabric. 
Using Pmods with an overlay
To use a peripheral two software components are required; a driver application written in C for the IOP, and a Python module. These components are provided as part of the Pynq package for supported peripherals. See the IO Processors: Writing your own software section of the documentation for writing drivers for your own peripherals. 
The Python module instantiates the peripheral, and loads the driver application to the appropriate IOP. The IOP will also be reset and start executing the new application. 
The Python module will send commands which the IOP will interpret and execute. The Python module may also send the data if necessary. The IOP will read from and write data into the shared memory area. 
Example: Using the OLED and the Ambient Light Sensor (ALS)
This examples requires the PmodOLED (OLED), and PmodALS (Ambient Light Sensor). 
Plug the PmodALS into PMODA, and PmodOLED into the top row of PMODB. (Currently, the PmodALS can only be used in the top row of a Pmod port.)
OLED displaying light reading from ambient light sensor:
Execute the next cell to load the FPGA fabric with the desired overlay, and then import the OLED module and instantiate it on PMODB:
End of explanation
oled.write("Hello World")
oled.clear()
Explanation: Try writing a message to the OLED.
End of explanation
from pynq.iop import Pmod_ALS
from pynq.iop import PMODA
als = Pmod_ALS(PMODA)
als.read()
Explanation: Import the ALS library, create an instance of the ALS Pmod, and read the value from the sensor.
End of explanation
oled.write("Light value : " + str(als.read()))
import time
from pynq.iop import Pmod_ALS
from pynq.iop import PMODA
als = Pmod_ALS(PMODA)
als.set_log_interval_ms(100)
als.start_log()
time.sleep(1)
als.stop_log()
als.get_log()
Explanation: Write the value from the ALS to the OLED. The ALS sensor returns an 8-bit value. 
0 : Darkest
255 : Brightest
End of explanation
<END_TASK>