mirror of
https://github.com/xodio/xod.git
synced 2026-03-03 23:44:04 +01:00
1.5 KiB
1.5 KiB
title
| title |
|---|
| Pulse Counting |
#23. Pulse Counting
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.
Let’s make a funky watch hand. Now we have everything to do this.
The clock will be the servo. Using the count node, we will change its
rotation from 0° to 180° in one minute.
The count node works as a simple counter. Each time it receives a pulse, it
increases the number that it gives out, in increments of the STEP pin.
Test circuit
↓ Download as a Fritzing project
How-to
- In the
clocknode, set the value ofIVALto1second. - In the
countnode, setSTEPto0.017. This means that every time the pulse arrives on theINCpin (in our case, once per second), the node will increase the number on the output by 0.017. For the servo node, this is approximately 3°. - Upload the patch to the Arduino.
You will see that the servo is “ticking” every second. In one minute, it will
reach 180°. The count node works as a simple counter. Each time it receives a
pulse, it increases the number that it gives out, in increments of the STEP
pin

