---
title: Input
description: 
published: 1
date: 2021-12-13T13:23:44.443Z
tags: 
editor: markdown
dateCreated: 2020-12-17T18:50:12.013Z
---

# Input 

| ![][menu] | [![][b1]][d1]&nbsp;&nbsp;&nbsp; [![][b2]][d2]&nbsp;&nbsp;&nbsp; [![][b3]][d3] <br>  [![][b4]][d4]&nbsp;&nbsp;&nbsp; [![][b5]][d5] <br> [![][b6]][d6]&nbsp;&nbsp;&nbsp; [![][b7]][d7]|
|---|:---|

<!--- (COMMENT - INPUT Category Images (Used above)
-->
[spacer]: /reference_manual/input/spacer.png
[menu]: /reference_manual/menus/menu_input_70p.png
[b1]: /reference_manual/input/buttona_50p.png
[b2]: /reference_manual/input/buttonb_50p.png
[b3]: /reference_manual/input/timer_50p.png
[b4]: /reference_manual/input/resettimer_50p.png
[b5]: /reference_manual/input/millis_50p.png
[b6]: /reference_manual/input/micros_50p.png
[b7]: /reference_manual/input/boardtype_50p.png

<!--- (COMMENT - INPUT Category Detail Bookmarks (Used above)
-->
[d1]: /reference_manual/input#button-a
[d2]: /reference_manual/input#button-b
[d3]: /reference_manual/input#timer
[d4]: /reference_manual/input#reset-timer
[d5]: /reference_manual/input#milliseconds
[d6]: /reference_manual/input#microseconds
[d7]: /reference_manual/input#board-type


## <br>button A  
## Tab {.tabset}
### Description
![buttona.png](/reference_manual/input/buttona.png)
Returns the state of the button A on the micro device as either true or false.

### Example
The state of button A is checked in an IF block, and a text message is displayed. If button A is pressed, "A pressed" is displayed, else "A not pressed".

![](/reference_manual/input/code_buttona.png)

[Download Example](/reference_manual/examples/code_buttons.ubp)


## <br>button B
## Tab {.tabset}
### Description
![](/reference_manual/input/buttonb.png)
Returns the state of the button B on the micro device as either true or false.

### Example
See button A example above.


## <br>timer
## Tab {.tabset}
### Description
![](/reference_manual/input/timer.png)
Returns milliseconds passed since the micro device was connected to the USB port (starting from 0ms), 
The timer increments regardless of the program start/stop status. To get a zero start point, use the **reset timer** block.

### Example
The program timer is reset. Then the program displays the timer amount after a certain amount of waiting.
![](/reference_manual/input/code_timer.png)

[Download Example](/reference_manual/examples/code_timer.ubp)


## <br>reset timer
## Tab {.tabset}
### Description
![](/reference_manual/input/resettimer.png)
Resets the program timer to zero.

### Example
See timer example above.


## <br>milliseconds
## Tab {.tabset}
### Description
![](/reference_manual/input/millis.png)
Returns milliseconds passed since the micro device was connected to the USB port (starting from 0ms), 
The milliseconds increment regardless of the program start/stop status. To get a duration, save the starting value and subtract it from the ending value.

### Example
Program calculates the duration of 200 additions using timer, milliseconds and microseconds blocks.

![](/reference_manual/input/code_millismicros.png)

[Download Example](/reference_manual/examples/code_millismicros.ubp)


## <br>microseconds
## Tab {.tabset}
### Description
![](/reference_manual/input/micros.png)
Returns microseconds passed since the micro device was connected to the USB port (starting from 0ms), 
The microseconds increment regardless of the program start/stop status. To get a duration, save the starting value and subtract it from the ending value.

### Example
Program calculates the duration of 200 additions using timer, milliseconds and microseconds blocks.

![](/reference_manual/input/code_millismicros.png)


## <br>board type
## Tab {.tabset}
### Description
![](/reference_manual/input/boardtype.png)
returns the type of the micro device connected to the USB port. 

### Board Types
Supported board types as of microBlocks v1.0.8.

![](/reference_manual/input/boardtypes.png)

### Example
Program display the type of micro device it is running on.

![](/reference_manual/input/code_boardtype.png)

[Download Example](/reference_manual/examples/code_boardtype.ubp)