#define DEBUG
#include "INHK_Pot3.h"
#define POT_NUM 6 // number of potentiometers
Potentiometer Pot[POT_NUM] = {{(A0), 2}, (A1), (A2), (A3), (A4), (A5)}; // creates a number (POT_NUM) of objects of Potentiometer class and passes the pin number as argument, and second parameter for range
int potReading [POT_NUM]; // variableto store the returned potentiometers reading values
//**********************************************************************************************************************************************
void setup() {
#ifdef DEBUG
Serial.begin(9600);
Serial.print("Number of pots: ");
Serial.println(Potentiometer::getCounter());
#endif
}
//**********************************************************************************************************************************************
void loop() {
updateAllPots();
}
void updateAllPots(){
for(int i = 0 ; i < POT_NUM; i ++) {
potReading [i] = Pot[i].readValue();
#ifdef DEBUG
Serial.print(F("Pot #")); Serial.print(i + 1);
Serial.write('\t');
Serial.print(Pot[i].readValue());
Serial.write((i == POT_NUM - 1) ? '\n' : '\t');
#endif
}
}