# Identifying your Arduino board from code

DevFeed: [Identifying your Arduino board from code](<https://devfeed.tech/articles/identifying-your-arduino-board-from-code-20705.md>)

Original publisher: [Read original article](<https://docs.microsoft.com/archive/blogs/abhinaba/identifying-your-arduino-board-from-code>)

Author: Abhinaba Basu \[MSFT\]

Published: 2016-02-21T16:18:49Z

Content type: tutorial

Language: en

Sources: [Abhinaba Basu](<https://devfeed.tech/sources/abhinaba-basu.md>)

Topics: [Arduino](<https://devfeed.tech/topics/arduino.md>), [Code](<https://devfeed.tech/topics/code.md>), [PowerShell](<https://devfeed.tech/topics/powershell.md>), [Internet of things](<https://devfeed.tech/topics/iot.md>), [ESP8266](<https://devfeed.tech/topics/esp8266.md>), [ide](<https://devfeed.tech/topics/ide.md>)

Tags: [arduino](<https://devfeed.tech/tags/arduino.md>), [arduino-ide](<https://devfeed.tech/tags/arduino-ide.md>), [code](<https://devfeed.tech/tags/code.md>), [esp8266](<https://devfeed.tech/tags/esp8266.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [ide](<https://devfeed.tech/tags/ide.md>), [iot](<https://devfeed.tech/tags/iot.md>), [powershell](<https://devfeed.tech/tags/powershell.md>), [project](<https://devfeed.tech/tags/project.md>)

## AI overview

This tutorial explains how to identify the selected Arduino board in code by reading board-specific definitions from the Arduino IDE's boards.txt file. It describes using those definitions to choose different serial interfaces for Arduino UNO and Arduino Mega, and mentions a PowerShell routine hosted on GitHub.

## Source excerpt

For my IoT project I needed to write code slightly differently for specific Arduino boards. E.g....