# Arduino code meaning

**URL:** <https://forum.core-electronics.com.au/t/arduino-code-meaning/8580>\
**Category:** Uncategorized\
**Created:** [13 October 2020 11:10 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580 "2020-10-13T11:10:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria140845](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@Maria140845](https://forum.core-electronics.com.au/u/Maria140845)\
**Post date:** [13 October 2020 11:10 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/1 "2020-10-13T11:10:50Z")

</div>

Text removed.

---

<div class="post-metadata">

**Author:** ![Oliver33](https://avatars.discourse-cdn.com/v4/letter/o/a9adbd/32.png) [@Oliver33](https://forum.core-electronics.com.au/u/Oliver33)\
**Post date:** [13 October 2020 13:42 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/2 "2020-10-13T13:42:01Z")

</div>

This is only part of a program. What’s the rest of it? What are you trying to do? Is this an example you’re trying to follow?

---

<div class="post-metadata">

**Author:** ![Maria140845](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@Maria140845](https://forum.core-electronics.com.au/u/Maria140845)\
**Post date:** [13 October 2020 22:56 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/3 "2020-10-13T22:56:58Z")

</div>

Yes it’s a example I’m trying to follow. Thanks you

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [13 October 2020 23:02 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/4 "2020-10-13T23:02:38Z")

</div>

Hi Maria,

Thanks for making a post 🙂

There are two main parts to an Arduino Sketch: the `setup()` function which runs once when the Arduino is powered on, and, the `loop()` function which runs on a continuous loop after the `setup()` has completed.

Ordinarily the `setup()` function will set up the variables and other important details. Without this context (or knowing how the Arduino is wired up) it’s difficult to say what this code is supposed to do.

Just going off the variable names it looks like this program is to drive a servo motor when a button or switch is turned on.

Regards,  
Oliver  
Support | Core Electronics

---

<div class="post-metadata">

**Author:** ![Maria140845](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@Maria140845](https://forum.core-electronics.com.au/u/Maria140845)\
**Post date:** [13 October 2020 23:06 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/5 "2020-10-13T23:06:04Z")

</div>

You are correct it’s when a switch is turned on. Would you able to assist me reading each line of the code?

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [13 October 2020 23:25 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/6 "2020-10-13T23:25:21Z")

</div>

Hi Maria,

Can you please provide the rest of the code and the context (particularly what is connected to the Arduino and how)? Do you have a URL/link to the example you’re following?

Unfortunately without more information it’s impossible to say what this code is doing.

I’d recommend working through our [Arduino for Beginners Workshop](https://core-electronics.com.au/tutorials/arduino-workshop-for-beginners.html).

Regards,  
Oliver  
Support | Core Electronics

---

<div class="post-metadata">

**Author:** ![Maria140845](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@Maria140845](https://forum.core-electronics.com.au/u/Maria140845)\
**Post date:** [13 October 2020 23:34 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/7 "2020-10-13T23:34:22Z")

</div>

thank you I’ll try that. please delete my post

---

<div class="post-metadata">

**Author:** ![Mitchell](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/mitchell/32/3564_2.png) [@Mitchell](https://forum.core-electronics.com.au/u/Mitchell)\
**Post date:** [14 October 2020 00:51 UTC](https://forum.core-electronics.com.au/t/arduino-code-meaning/8580/8 "2020-10-14T00:51:45Z")

</div>

Hi Maria, If you wish to delete your posts you can do so by clicking the edit button on each post.
