How to import GPIO and toggle led on apalis imx 8 using Visual Studio Code as compiler

Hi,
I am trying to toggle led using Apalis Evaluation Board IMX8QM on Visual Studio Code using Python

Followed this link to setup Visual Studio Code : Python Development and Debugging on TorizonCore Using Visual Studio Code (toradex.com)
Please let me know how it has to be done since I am getting an error when I type this code specifically at import gpiod
import gpiod
import time

   chip=gpiod.Chip('gpiochip0')

lines = chip.get_lines([ 12 ])
lines.request(consumer=‘gpio’, type=gpiod.LINE_REQ_DIR_OUT)
lines.set_values([ 0 ])
counter = 0

while counter < 5:
lines.set_values([1])
time.sleep(1)
lines.set_values([0])
time.sleep(1)
counter = counter +1
exit()

Hi @ShubhamD,

Welcome to Toradex community.

Regarding your query please check similar post below:

Please feel free to write us back if above post is not helpful with your query.

Best Regards
Ritesh Kumar