This page has no translation to Português yet. The original English version is below. If you’d like to help, great! See how to translate a documentation page in the contribution guide.
Note This is a web-version of a tutorial chapter embedded right into the XOD IDE. To get a better learning experience we recommend to install the desktop IDE or start the browser-based IDE, and you’ll see the same tutorial there.

Slow Down

Screenshot of 209-slow-down

You often see the “Loop” value bound to UPD pins.

“Loop” (also known as “Continuously”) means that XOD tries to pulse these nodes as fast as it can. These nodes evaluate themselves on each transaction.

Sometimes it’s excessive and may lead to slowing the program performance. Especially if you’re working with sensors that depend on timing like an ultrasonic range meter.

To avoid this, you can replace the “Continuously” with another source that pulses with the desired interval or only when necessary. For example, a clock node.

Exercise #

Make the temperature display less sporadic.

  1. Place a clock node.
  2. Link it with the UPD pin of the thermometer-tmp36 node.
  3. Upload the program.

Heat and cool down the thermometer and observe the incremental changes of the data shown.

Found a typo or mistake? Want to improve the text? Edit this page on GitHub and open a pull request. If you have a complex proposal or you want to discuss the content, feel free to start a new thread on XOD forum.