matrixSelector.h 1.4 KB
#ifndef _matrixSelector_h_
#define _matrixSelector_h_
#include "config.h"
#include <arduino.h>
//#include <EEPROMex.h>
#include <EEPROM.h>


class matrixSelector {
  public:



    matrixSelector(int _threshold );
    // ~matrixSelector();

    void initial();
    long getadc(int pin , boolean txEn);
    bool getstatus(int pin);
    void calibrate(int pin,int mode);
    void setcalnum(HardwareSerial *sl,int startpin,int endpin,int max,int min , int threshold );
    void getcalnum(HardwareSerial *sl,int startpin,int endpin,int max,int min , int threshold );
    int getmax(int pin);
    int getmin(int pin);
    int getthreshold(int pin);
    int readIntFromEEPROM(int address);
    short readShortFromEEPROM(int address);
    void writeIntIntoEEPROM(int address, int number,bool nocommit);
    void writeShortIntoEEPROM(int address, short number,bool nocommit);
    void writeIntIntoEEPROM(int address, int number);
    void writeShortIntoEEPROM(int address, short number);
    void EEPROMcommit();
    int sendelay=0;
    int ledcount=100;
    bool diagnosMode=false;
    bool factoryMode=false;
    //char *internalBuffer;
    //uint16_t internalBufferSize = 0;

  private:
    int select_pin[10] = { 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 };
    int  sense_pin[10] = {  1 ,  2 ,  3 ,  4 ,  5 ,  6 ,  7 ,  8 ,  9 , 10 };
    

    int threshold;
    const int maxAllowedWrites = 1000;
    const int memBase          = 200;
    int addressInt ;

   




};



#endif