# Is there a sample app using gpio pin?

**URL:** <https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522>\
**Category:** mangOH Yellow\
**Created:** [May 27, 2020, 8:35am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522 "2020-05-27T08:35:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SeongBeom27](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SeongBeom27](https://mangoh.discourse.group/u/SeongBeom27)\
**Post date:** [May 27, 2020, 8:35am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/1 "2020-05-27T08:35:53Z")

</div>

I am using gpio pin using Iot#0.

However, even though I was referring to the Legato site and programming it, I kept failing.

The final goal is to use Serial Communicating by using RS-232 as a GPIO pin, but before that, simple LED control and switch control with a pin would be a great help.

I would appreciate it if you could give me directions to the place where such a source exists.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 27, 2020, 9:00am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/2 "2020-05-27T09:00:53Z")

</div>

I don’t see UART is multiplexed with GPIO function in the PTS, so I don’t think you can make it as GPIO pin.

---

<div class="post-metadata">

**Author:** ![SeongBeom27](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SeongBeom27](https://mangoh.discourse.group/u/SeongBeom27)\
**Post date:** [May 27, 2020, 10:45am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/4 "2020-05-27T10:45:43Z")

</div>

umm… I amended my question!! I just use Serial Communicating by using RS-232

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 27, 2020, 11:11am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/5 "2020-05-27T11:11:31Z")

</div>

You can use sysfs command to control gpio

> [@Controlling WP\_GPIO\_1 / GPIO22 problem](https://mangoh.discourse.group/t/controlling-wp-gpio-1-gpio22-problem/984):
>
> Hello I try to control gpio22 (WP\_GPIO\_2 on the mangoh Red, pin13 on PI header) but I get a warning when starting the app: -WRN- | gpioService[789]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs\_SessionOpenHandlerFunc() 1112 | Unable to export GPIO gpio22 for use - stopping session Changing to gpio21 and the app works fine. Any tips to get gpio22 working? [image]

---

<div class="post-metadata">

**Author:** ![SeongBeom27](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SeongBeom27](https://mangoh.discourse.group/u/SeongBeom27)\
**Post date:** [May 28, 2020, 6:08am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/7 "2020-05-28T06:08:09Z")

</div>

I used the sysfs command, but I don’t know what api can be used to produce the desired output on the digital pin through which function call can be used.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 28, 2020, 6:18am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/8 "2020-05-28T06:18:36Z")

</div>

[gpioCf3Demo\_GPIO\_output.rar](https://mangoh.discourse.group/uploads/short-url/aLF7FVezFuWeUTNytKASWPrXaJS.rar) (2.7 KB)

You can use this app to control GPIO 13.

---

<div class="post-metadata">

**Author:** ![SeongBeom27](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SeongBeom27](https://mangoh.discourse.group/u/SeongBeom27)\
**Post date:** [May 30, 2020, 8:06am UTC](https://mangoh.discourse.group/t/is-there-a-sample-app-using-gpio-pin/4522/9 "2020-05-30T08:06:18Z")

</div>

thanks jyijyi!! After I try to use this application, I reply again 😃 😃 😃
