Analog Input

In this example, you will see how to use the I/O Control Panels to monitor an analog input (a potentiometer on pin A0).

The use of a potentiometer is not required : you can replace it with any analog sensor you have, or you can even leave pin A0 unconnected and watch electrical noise on the analog input.

Wiring diagram

Connect a potentiometer on analog pin A0.

Sketch

In HITIPanel, open this project Example : 1_Basics \ 2_AnalogInput

In the Arduino Sketch, we start by initializing our base library HITIComm with HC_begin().

Then we place HC_communicate() inside the loop() to continuously handle communication between your Arduino and HITIPanel. This function also retrieves in the background the I/O configuration and values.

#include <HITIComm.h>

void setup()
{
    // initialize library
    HC_begin(); 
}

void loop()
{
    // communicate with HITIPanel
    HC_communicate(); 
}

Control Panels

1) Open the I/O Control Panels (“IO” button).

2) Turn the potentiometer knob and see the value changing accordingly in the Command Panel of pin A0.

Chart

1) Open the Chart window (CTRL+T or Tools\Chart).

2) Start data acquisition.

3) The chart continuously displays the last 5 seconds and add new values every 10ms. Turn the potentiometer knob and see the plot changing accordingly. Then stop data acquisition.

CONTENTS

HITISoftware

Control and Monitoring Software for Arduino