Dear all,
I am trying to read 30 analog value Using arduino UNO Board. using Mux network. Could someone help me how to create a time frame In arduino like in Truth table.Truth table as given below image. Ao and A1 analog pin read
int sensorArray[32] ;
int selectPinZero = 8;
int selectPinOne = 9;
int selectPinTwo = 10;
int selectpinthree=11;
int inputPinOne = 0;
int inputPinTwo = 1;
static float ARDUINO_ANALOG_SCALING = 0.00488758;
int sensor1;
int sensor2;
int voltage1;
int voltage2;
int Current_Sensor1;
int Current_Sensor2;
int array[17][5]={
{0,0,0,0,0},
{0,0,0,0,1},
{0,0,0,1,0},
{0,0,0,1,1},
{0,0,1,0,0},
{0,0,1,0,1},
{0,0,1,1,0},
{0,0,1,1,1},
{0,1,0,0,0},
{0,1,0,0,1 },
{0,1,0,1,0},
{0,1,0,1,1},
{0,1,1,0,0 },
{0,1,1,0,1},
{0,1,1,1,0 },
{0,1,1,1,1},
{1,0,0,0,0}
};
void setup(){
pinMode(selectPinZero, OUTPUT);
pinMode(selectPinOne, OUTPUT);
pinMode(selectPinTwo, OUTPUT);
pinMode(selectpinthree,OUTPUT);
pinMode(inputPinOne, INPUT);
pinMode(inputPinTwo, INPUT);
}
void loop()
{
for(row=0;row<17;row++)
{
for(column=0;column<5;column++);
{
digitalWrite(Enablepin,array[row][column]);
digitalWrite(selectPinZero,array[row][column+1]);
digitalWrite(selectPinOne,array[row][column+2]);
digitalWrite(selectPinTwo,array[row][column+3]);
digitalWrite(selectpinthree,array[row][column+4]);
sensor1=analogRead(inputPinOne);
sensor2=analogRead(inputPinTwo);
voltage1=sensor1 * ARDUINO_ANALOG_SCALING;
voltage2=sensor2* ARDUINO_ANALOG_SCALING;
Current_Sensor1=(10*voltage1)-25;
Current_Sensor2=(10*voltage2)-25;
}
}
}
cd74hc4067.pdf (385 KB)
MC14067B-D.PDF (137 KB)