# Input output

Una manera rápida de probar las entradas y salidas de microbit es utilizar el código predefinido que hay en reference

Si entramos en simulación, al pulsar sobre el PIN0 se visualiza 0 en el display

[![2024-09-22 14_25_04-micro_bit Python Editor.png](https://libros.catedu.es/uploads/images/gallery/2024-09/scaled-1680-/2024-09-22-14-25-04-micro-bit-python-editor.png)](https://libros.catedu.es/uploads/images/gallery/2024-09/2024-09-22-14-25-04-micro-bit-python-editor.png)

Podemos ahora usar bloques lógicos para tener otras posibilidades:

```
# Imports go at the top
from microbit import *
while True:
    if pin0.is_touched():
        display.show(Image.HEART)
    else:
        display.show(Image.NO)
```

<iframe allowfullscreen="allowfullscreen" height="314" src="https://www.youtube.com/embed/uI2p9HazV1Y" width="560"></iframe>