matrixSelector.h
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#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