# Entradas

##### <span style="color: rgb(22, 145, 121);">**Botones A y B**</span>

Si aprieto el botón A pues enciendo leds, si aprieto B los apago

```python
import cyberpi

"""
Button Name List (str)

a , b 
up, down, left , right , middle
any_direction , any_button , any

"""
while True:
                             # button name
    if cyberpi.controller.is_press('a'):
        cyberpi.led.on(255,0,0,id='all')
        cyberpi.console.println("LED ON!")
    if cyberpi.controller.is_press('b'):
        cyberpi.led.on(0,0,0,id='all')
        cyberpi.console.println("LED OFF!")
```

{{@13396#bkmrk-extraido-de-https%3A%2F%2F}}

<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" frameborder="0" height="599" src="https://www.youtube.com/embed/1w7q_3t6nEM" title="botones mbot2 python" width="337"></iframe>

##### <span style="color: rgb(22, 145, 121);">**Intensidad de la luz**</span>

*<span style="color: rgb(0, 0, 0);">La función show\_label la veremos después, tiene el formato <span class="ͼe">cyberpi</span><span class="ͼ8">.</span>display<span class="ͼ8">.</span>show\_label(<span class="ͼe">texto</span>, <span class="ͼe">tamaño</span>, <span class="ͼe">color, x, y</span>)</span>*

```python
import cyberpi

cyberpi.display.show_label("LUZ=",16,0,0,0)

while True:
    CantidadLuz = cyberpi.get_brightness()
    cyberpi.display.show_label(CantidadLuz,16,0,60,1)
```

{{@13396#bkmrk-extraido-de-https%3A%2F%2F}}

<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" frameborder="0" height="635" src="https://www.youtube.com/embed/DyamGMRte7w" title="luz python mbot2" width="357"></iframe>

##### <span style="color: rgb(22, 145, 121);">**Cantidad de sonido**</span>

```
import cyberpi

cyberpi.display.show_label("Loudness:",16,10,10,index=1)

while True:
    loudness_value = cyberpi.get_loudness()
    cyberpi.display.show_label(loudness_value,16,80,10,index=2)
```

{{@13396#bkmrk-extraido-de-https%3A%2F%2F}}

<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" frameborder="0" height="635" src="https://www.youtube.com/embed/_xFezHI2N9o" title="cantidad de sonido Python mbot2" width="357"></iframe>

##### <span style="color: rgb(22, 145, 121);">**Nivel de batería**</span>

```python
import cyberpi

cyberpi.display.show_label("Battery Level",16,10,0,index=0)
cyberpi.display.show_label("Builtin:",16,10,20,index=1)
cyberpi.display.show_label("Extra:",16,10,40,index=2)

while True:
    builtin_batt = cyberpi.get_battery()
    extra_batt = cyberpi.get_extra_battery()
    
    cyberpi.display.show_label(builtin_batt,16,80,20,index=3)
    cyberpi.display.show_label(extra_batt,16,80,40,index=4)
```