<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 Grove PIR Motion Sensor
This example shows how to use the Grove PIR motion sensor.
This demo requires the Grove PIR motion sensor and PYNQ Grove Adapter.
1. Download overlay
Download the overlay. Instantiate Grove PIR object. 
In this example, the Grove PIR sensor is assumed to be connected to G1 on the PYNQ Grove Adapter. The Grove Adapter is connected to PMODA interface on board.
Step1:  2. Detect motion
We can now start the motion detection loop. 
When the cell below is executed, the LED will keep flashing until the PIR detects some movement.
Step2:  3. Clean-up
Delete objects.
<ASSISTANT_TASK:>
Python Code:
from time import sleep
from pynq import Overlay
from pynq.board import LED
from pynq.iop import Grove_PIR
from pynq.iop import PMODA
from pynq.iop import PMOD_GROVE_G1
ol1 = Overlay("base.bit")
ol1.download()
pir = Grove_PIR(PMODA,PMOD_GROVE_G1)
Explanation: PMOD Grove PIR Motion Sensor
This example shows how to use the Grove PIR motion sensor.
This demo requires the Grove PIR motion sensor and PYNQ Grove Adapter.
1. Download overlay
Download the overlay. Instantiate Grove PIR object. 
In this example, the Grove PIR sensor is assumed to be connected to G1 on the PYNQ Grove Adapter. The Grove Adapter is connected to PMODA interface on board.
End of explanation
led = LED(0)
led.on()
if pir.read()==0:
    print("Starting detection...")
    while True:
        led.on()
        sleep(0.1)
        led.off()
        sleep(0.1)
        if pir.read()==1:
            print("Detected a motion.")
            break
print("Ending detection...")
Explanation: 2. Detect motion
We can now start the motion detection loop. 
When the cell below is executed, the LED will keep flashing until the PIR detects some movement.
End of explanation
del pir
del led
del ol1
Explanation: 3. Clean-up
Delete objects.
End of explanation
<END_TASK>