# Digital read pin does not work

**URL:** <https://forum.makecode.com/t/digital-read-pin-does-not-work/22947>\
**Category:** micro:bit\
**Created:** [October 2, 2023, 4:48pm UTC](https://forum.makecode.com/t/digital-read-pin-does-not-work/22947 "2023-10-02T16:48:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmll](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@kmll](https://forum.makecode.com/u/kmll)\
**Post date:** [October 2, 2023, 4:48pm UTC](https://forum.makecode.com/t/digital-read-pin-does-not-work/22947/1 "2023-10-02T16:48:28Z")

</div>

I am trying to create a simple program to read pin0, but it does not work. Any suggestions?  
The pseudocode is like this:

```auto
forever
    if digital pin0 = 1
    show some leds

```

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [October 2, 2023, 11:50pm UTC](https://forum.makecode.com/t/digital-read-pin-does-not-work/22947/2 "2023-10-02T23:50:18Z")

</div>

Hi @kmll , Welcome to the forum.

Is the code in Python or MakeCode? Did you do anything special to set up the pin (pull up or pull down) and how are you testing it?

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [October 4, 2023, 11:23pm UTC](https://forum.makecode.com/t/digital-read-pin-does-not-work/22947/3 "2023-10-04T23:23:37Z")

</div>

Welcome, @kmll, and sorry to intrude here, @bsiever!

But I am trawling the forum to find questions to drill and challenge my own skills using MakeCode, and I found this one interesting and relevant.

With reference to @bsiever’s follow-up questions, I am not sure if this answer your question, but here is a code example which I believe does what you ask, shows some LEDs if pin0 is set to digital 1 by physically either connecting pin1 to pin0 or from an outside source to pin0. In simulator, just press pin0 to activate/set to 1.

> **[pin0=1](https://makecode.microbit.org/61805-63928-13155-27862)**
>
> Made with ❤️ in Microsoft MakeCode for micro:bit.

---

<div class="post-metadata">

**Author:** ![kmll](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@kmll](https://forum.makecode.com/u/kmll)\
**Post date:** [October 10, 2023, 8:22pm UTC](https://forum.makecode.com/t/digital-read-pin-does-not-work/22947/4 "2023-10-10T20:22:14Z")

</div>

Thank you for the advise. I also posted the question in another forum and please have a look at the reply here if you want more details about the issue: [https://support.microbit.org/support/tickets/67502](https://support.microbit.org/support/tickets/67502)
