# Arduino analog read blocked after initialize hdmi

**URL:** <https://discuss.pynq.io/t/arduino-analog-read-blocked-after-initialize-hdmi/8649>\
**Category:** Community corner\
**Created:** [July 29, 2025, 5:30am UTC](https://discuss.pynq.io/t/arduino-analog-read-blocked-after-initialize-hdmi/8649 "2025-07-29T05:30:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slawalata](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/slawalata/32/7166_2.png) [@slawalata](https://discuss.pynq.io/u/slawalata)\
**Post date:** [July 29, 2025, 5:30am UTC](https://discuss.pynq.io/t/arduino-analog-read-blocked-after-initialize-hdmi/8649/1 "2025-07-29T05:30:51Z")

</div>

Hi,

I try to build a pet project to _read from arduino analog pin_ and _put or plot it on hdmi screen_.

```auto
from pynq.overlays.base import BaseOverlay
from pynq.lib.arduino.arduino_analog import Arduino_Analog
from pynq.lib.video import *
from time import sleep

print("All libraries loaded")

ol = BaseOverlay('base.bit')
xadc = Arduino_Analog(ol.ARDUINO,[1]) #A1

print("read from sensor 1")
value_from_sensor = xadc.read()
print(f"Values xadc: {value_from_sensor}")

frame_height = 600
frame_width = 800

base = BaseOverlay("base.bit")
hdmi_out = base.video.hdmi_out

Mode = VideoMode(frame_width, frame_height, 24, fps=60)
hdmi_out.configure(Mode,PIXEL_BGR)
hdmi_out.start()
sleep(2)

print("Hdmi out start.")
print(hdmi_out.mode)

y_offset = 200
img_in_array = np.zeros((frame_height, frame_width, 3), dtype=np.uint8)
img_in_array[y_offset, :] = (255, 255, 255)

frame = hdmi_out.newframe()
print("Hdmi out frame created.")

for x in range(0, frame_width):
    print("read from sensor")
    value_from_sensor = xadc.read() # always blocked
    print(f"Values xadc: {value_from_sensor}")
    
input("Step function completed. Press ENTER to exit.")
hdmi_out.stop()
hdmi_out.close()

```

I found if i load all thing related with hdmi `xadc.read()` will be blocked and never return value.  
If I comment or remove all related with hdmi, `xadc.read()` will return a value.  
My board : xilinx pynq-z2

Have i miss something in how to use this? Suggestion is highly appreciated.  
Thanks in advance.

regards  
sLawalata

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [July 31, 2025, 7:41am UTC](https://discuss.pynq.io/t/arduino-analog-read-blocked-after-initialize-hdmi/8649/2 "2025-07-31T07:41:33Z")

</div>

Hi @slawalata,

Welcome to the PYNQ community.

You are downloading the overlay twice (`ol = BaseOverlay(‘base.bit’)`), the second time you run this, will clear any previous state. Remove the repeated line (second instance) and try again.

Mario
