# How can I access the name of my program?

**URL:** <https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764>\
**Category:** EV3\
**Created:** [November 12, 2019, 4:50am UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764 "2019-11-12T04:50:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![stheyounger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/stheyounger/32/453_2.png) [@stheyounger](https://forum.makecode.com/u/stheyounger)\
**Post date:** [November 12, 2019, 4:50am UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/1 "2019-11-12T04:50:53Z")

</div>

I want to display the name of my program on the screen. I have the version number in the name and change it every time I download code. I couldn’t find any variable to access the name. Is there one?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [November 12, 2019, 7:09pm UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/2 "2019-11-12T19:09:08Z")

</div>

I don’t think we have an API for that, unfortunately. Feel free to file a feature request here: [https://github.com/microsoft/pxt-ev3/issues](https://github.com/microsoft/pxt-ev3/issues)

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [November 26, 2019, 1:38am UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/3 "2019-11-26T01:38:37Z")

</div>

`control.programName()` is available at [https://makecode.mindstorms.com/beta](https://makecode.mindstorms.com/beta)

---

<div class="post-metadata">

**Author:** ![stheyounger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/stheyounger/32/453_2.png) [@stheyounger](https://forum.makecode.com/u/stheyounger)\
**Post date:** [November 26, 2019, 2:17am UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/4 "2019-11-26T02:17:26Z")

</div>

Awesome! Do you know when this feature will be available outside of beta?

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forum.makecode.com/u/kjw)\
**Post date:** [November 26, 2019, 7:27pm UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/5 "2019-11-26T19:27:59Z")

</div>

Is there any way to access the device type or its capabilities from a MakeCode program? I’d like to be able to write code which uses NeoPixels on PyGamer if it runs on a PyGamer and uses the vibration motor on Kitronik ARCADE if it runs on one of those. I’d like to do that in Blocks.

Some sample code showing the recommended way to do this would be really useful.

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [November 26, 2019, 7:31pm UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/6 "2019-11-26T19:31:52Z")

</div>

I believe these APIs are no-ops (or should be, if not file a bug) when the feature is absent. So you can just use the feature (vibration, neopixels, whatever) and it will be just ignored if the hardware doesn’t have it.

It’s a bad idea to detect a specific board, since there are new boards being added. Feature detection would be more useful I guess.

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forum.makecode.com/u/kjw)\
**Post date:** [December 4, 2019, 12:50pm UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/7 "2019-12-04T12:50:32Z")

</div>

The no-op approach prohibits alternate behaviour based on features, e.g.

```auto
IF got-five-neopixels THEN
  flash neopixels
ELSE
  flash bottom of screen
ENDIF

```

And there’s the question of what do input based ones do, e.g. light sensor.

I agree that board detection is a niche case but there’s no reason to prohibit it. This is useful for code which tests hardware with user interaction to ensure it’s healthy. For classroom use you sometimes want to be able to put something on the board for students/teachers to quickly make sure everything is functioning and working normally.

BTW, on a slightly different subject, I’ve not tried putting the wrong target `.uf2` file on a device. What’s supposed to happen there?

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [December 20, 2019, 1:07am UTC](https://forum.makecode.com/t/how-can-i-access-the-name-of-my-program/764/8 "2019-12-20T01:07:06Z")

</div>

There is `control.getConfigValue` API that you can use to probe the board the same way the runtime does. You can drop current.uf2 from your board on [https://microsoft.github.io/uf2/patcher/](https://microsoft.github.io/uf2/patcher/) to see actual config of your board. You should be able to use `control.getConfigValue(DAL.CFG_BOOATLOADER_BOARD_ID, 0)`, however some manufacturers just clone an existing config and you end up with multiple boards with the same ID. However you can query other things, for example `control.getConfigValue(DAL.CFG_NUM_NEOPIXELS, 0)`. Feel free to wrap this up in an extension!

If you drop wrong UF2 it will be ignored, due to family-ID feature, see [https://github.com/microsoft/uf2#family-id](https://github.com/microsoft/uf2#family-id)
