MAX-7219 controlling Electromagnets

PaulRB:
Hi. You said you have found a circuit for this somewhere? Please post a link to that. I cannot imagine how such a circuit as you describe could work, especially using relays!

If I were designing a circuit for 64 electromagnets, I might use 8 tpic6*595 shift registers if the current required by the electromagnets is low enough. Otherwise 8 74hc595 shift registers and 64 MOSFETs.

Hi, @PaulRB

the attach file is the circuit blueprint. Sorry, I don't know how to draw a standard one.

in my limited knowledge of that, you said the shift register that I heard first time.

before, I use the <LedControl.h> library wrote program.

#include <LedControl.h>

int DIN = 2;
int CS = 4;
int CLK = 6;

LedControl lc = LedControl(DIN, CLK, CS, 1);

void setup() {
//Serial.begin(9600);
lc.shutdown(0,false);
lc.setIntensity(0,15);
lc.clearDisplay(0);
}

void matrix() {
byte f1[8] = {
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
B11111111,
};

for (int i = 0; i <= 7; i++) {lc.setRow(0,i,f1*);}*
}
void loop() {

  • matrix();*
  • lc.clearDisplay(0);*
    }
    [/td]
    [/tr]
    [/table]
    1 is on, 0 is off.
    could the "74hc595" use the LedControl library?