# Figuring out how to make a buzzer node

**URL:** <https://forum.xod.io/t/figuring-out-how-to-make-a-buzzer-node/800>\
**Category:** Uncategorized\
**Created:** [May 25, 2018, 10:42pm UTC](https://forum.xod.io/t/figuring-out-how-to-make-a-buzzer-node/800 "2018-05-25T22:42:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [May 28, 2018, 7:33am UTC](https://forum.xod.io/t/figuring-out-how-to-make-a-buzzer-node/800/3 "2018-05-28T07:33:13Z")

</div>

Hello!

You can try to make a simple C++ wrapper node around Arduino’s `tone` and `noTone`. Something like:

```cpp
// ... not checked draft ...

void evaluate(Context ctx) {
    auto port = getValue<input_PORT>(ctx);
    auto freq = getValue<input_FREQ>(ctx);
    auto enable = getValue<input_EN>(ctx);
    
    if (enable) {
        pinMode(port, OUTPUT);
        tone(port, freq);
    } else {
        noTone(port);
    }
}

```

---

_[View the full topic](https://forum.xod.io/t/figuring-out-how-to-make-a-buzzer-node/800)._
