Home » Programacion » Facilino » Facilino Ejemplo » Digital Input Read (Switch) with Facilino

Digital Input Read (Switch) with Facilino

In this post, we show how to read a digital input in Facilino. We show three examples using different instructions, but all of them produce the same result.

The aim of this post is to show how to read a digital input in Facilino. Facilino has generic purpose instructions to read digital inputs, but also specific ones to read values from a switch. Both of them produce the same results, so the specific ones can be used one reading from a switch. In addition to this, there’s also another switch-specific instruction that can distinguish between cases (pressed or released).

We want to show on Facilino’s console (or Arduino IDE) the state of the switch.

Circuit

Here we show the required circuit to complete the example. The switch has been connected to the digital input D2 of Arduino Nano.

Facilino

The following three examples produce the same result, they are simply three different ways for solving the problem.

Example 1

Example 2

Example 3