< Back

This example shows you how to read analog input from your Controllino device over serial communication. In order to do this, you have to connect potentiometer on one analog input and establish serial communication between your Controllino board and your computer running the Arduino Software(IDE).

Please, select proper target board in Tools->Board->Controllino MINI/MAXI/MEGA before Upload to your CONTROLLINO.
(Please, refer to https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library if you do not see the CONTROLLINOs in the Arduino IDE menu Tools->Board.)


  • Controllino MINI/MAXI/MEGA
  • 10k ohm potentiometer


#include <Controllino.h> 
/* Usage of CONTROLLINO library allows you to use CONTROLLINO_xx aliases in your sketch. */

// the setup routine runs once when you press reset:
void setup() {
    // initialize necessary pin as input pin
    // initialize serial communication at 9600 bits per second:

// the loop routine runs over and over again forever:
void loop() {
    // read the input on analog pin 0:
    int sensorValue = analogRead(CONTROLLINO_A0);
    // print out the value you read:
    delay(1); // delay in between reads for stability

Pin header is working on 5V TTL levels. Voltage levels over 5.5V can damage the Controllino permanently.


This is a paragraph.It is justify aligned. It gets really mad when people associate it with Justin Timberlake. Typically, justified is pretty straight laced. It likes everything to be in its place and not all cattywampus like the rest of the aligns. I am not saying that makes it better than the rest of the aligns, but it does tend to put off more of an elitist attitude.