const int sensePin = 33;
const int s3 = 25;
const int s2 = 26;
const int s1 = 27;
const int s0 = 14;
char selection[] = {14,27,26,25};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(sensePin, INPUT);
pinMode(s3, OUTPUT);
pinMode(s2, OUTPUT);
pinMode(s1, OUTPUT);
pinMode(s0, OUTPUT);
}
void loop()
{
for(int i = 0; i<16;i++)
{
for(int j = 0; j<4; j++)
{
digitalWrite(selection[j], bitRead(i,j));
Serial.print(bitRead(i,j));
}
Serial.println("");
Serial.print("C");
Serial.print(i);
Serial.print(" = ");
Serial.println(analogRead(sensePin));
delay(2000);
}
}
Loading
cd74hc4067
cd74hc4067