# Code snippet needed

**URL:** <https://discourse.processing.org/t/code-snippet-needed/16200>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [December 7, 2019, 6:56am UTC](https://discourse.processing.org/t/code-snippet-needed/16200 "2019-12-07T06:56:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![urthlight](https://avatars.discourse-cdn.com/v4/letter/u/ec9cab/32.png) [@urthlight](https://discourse.processing.org/u/urthlight)\
**Post date:** [December 7, 2019, 6:56am UTC](https://discourse.processing.org/t/code-snippet-needed/16200/1 "2019-12-07T06:56:52Z")

</div>

Does anyone have a more advanced handshaking sketch? Sensor data from Nano. Buttons and sliders from Processing to variables in the nano

---

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [December 7, 2019, 2:00pm UTC](https://discourse.processing.org/t/code-snippet-needed/16200/2 "2019-12-07T14:00:42Z")

</div>

For the Buttons you can take a look at the controlP5 Library, which you can directly Download in the Processing IDE, under the libraries tab.

As for handshaking with the Arduino Nano, you can use the Serial library for Serial Communication, which you can too Download directly in the IDE.

---

<div class="post-metadata">

**Author:** ![urthlight](https://avatars.discourse-cdn.com/v4/letter/u/ec9cab/32.png) [@urthlight](https://discourse.processing.org/u/urthlight)\
**Post date:** [December 7, 2019, 5:09pm UTC](https://discourse.processing.org/t/code-snippet-needed/16200/3 "2019-12-07T17:09:32Z")

</div>

I have all of that and have most of my features working, but i am having difficulty getting it all to behave. I was hoping to find a working handshaking backbone to hang all of my code on.

---

<div class="post-metadata">

**Author:** ![Lexyth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lexyth/32/7403_2.png) [@Lexyth](https://discourse.processing.org/u/Lexyth)\
**Post date:** [December 7, 2019, 5:11pm UTC](https://discourse.processing.org/t/code-snippet-needed/16200/4 "2019-12-07T17:11:52Z")

</div>

Here you got an example :

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/17597/processing-to-arduino-serial)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

You‘ll just have to adapt it to your own project and all should be good

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [December 7, 2019, 5:21pm UTC](https://discourse.processing.org/t/code-snippet-needed/16200/5 "2019-12-07T17:21:16Z")

</div>

If it is the basic know-how you need; in [this](https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all) link on the bottom of the page, it is explained.
