Issues encountered in manipulating the 16×16 coil array

Hello everyone, I am a beginner in programming and have encountered some issues. As shown in the diagram, the bottom right corner features a 16×16 coil array. I am using the ADG1606 on the upper left of the diagram to control the 16 columns and the ADG1606 on the upper right to control the 16 rows. I connected the 2×5 switch chip and the 1×5 switch chip to an Arduino, aiming to use the Arduino to control the first row of coils to open and close sequentially.

My connections are as follows:
The VDD and GND of the 2×5 switch are connected to the 3.3V and GND of the Arduino, respectively. The A0, A1, A2, A3, and EN1 of the 2×5 switch, as well as the A0, A1, A2, A3, and EN2 of the 1×5 switch, are connected to the Arduino's digital ports 2 to 11.

However, during the experiment, the IN and OUT terminals could not connect to the power supply, and I was unable to make the first row of coils open and close as intended. My program is shown in the diagram.


预先格式化的文本

What diagram?

What power supply?

@zhegeren23
Do not use a pictures instead the code.
Please insert your full code as text, using code tags.

I'm sorry. This's my problem.

void setup() {
Serial.begin(9600);
  for (int pin = 2; pin <= 11; pin++) {
    pinMode(pin, INPUT);
  }
}
void loop() {
  digitalWrite(7, LOW);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);
  digitalWrite(10, LOW);
  digitalWrite(6, HIGH);
  digitalWrite(11, HIGH);//Set the enable terminals 6 and 11 to high
  delay(200);
  for (int i = 0; i < 16; i++) {
   for (int pin = 2; pin <= 5; pin++) {
    int state=(i >> (pin - 2)) & 1;
    digitalWrite(pin, state);
    Serial.print("Pin");
    Serial.print(pin);
    Serial.print("=");
    Serial.print(state);
    Serial.print(" ");
    }
  Serial.println();
  delay(800);  
    
}
}

Apologies for any confusion caused by the wording in my translated text, as I used software to translate my statements into English. By "diagram," I am referring to the PCB layout I provided, and by "power supply," I mean an external voltage source I am using.

The ADG1606 I am using is the one shown at the top in the two images you provided.I configured the D pins of the ADG1606 that controls the columns as inputs, connecting them to the positive terminal of the voltage source. For the ADG1606 that controls the rows, I configured the D pins as outputs, connecting them to the negative terminal of the voltage source.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.