4*4 Driver Shield Software Help (74AHCT595)

Hello,

I am trying to build a project around the 4*4 Driver Shield by Logos Electromechanical but I can't understand their reference for the software.

That's what they share:

digitalWrite(7, LOW);    // Prepares latch 
digitalWrite(8, HIGH);    // Deactivates master reset
shiftOut(13, 12, MSBFIRST, highByte);    // shift data for OUT8-OUT15
shiftOut(13, 12, MSBFIRST, lowByte);    // shift data for OUT0-OUT7
digitalWrite(7, HIGH);    // latch data

Which I don't really understand. More info on the shield here: http://wiki.logos-electro.com/4x4-driver-shield-manual

I need to be able to open and close independently every pin controlled by the mosfets. Can somebody help?

Many thanks!

I need to be able to open and close independently every pin controlled by the mosfets. Can somebody help?

What have you tried? That seems quite straightforward. Each bit in the value highByte, and each bit in the value lowByte controls one output pin.

You can use bitSet() to diddle with an int, and then use highByte() and lowByte() to extract the high and low bytes from the int.

Hi PaulS,

thanks for your answer. I am not really sure how this bits thing works, I have read all the references but really couldn't understand much.

This is what I tried:

int latchPin = 7;
int dataPin = 11;
int clockPin = 13;


void setup() {


  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  
  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:

digitalWrite(7, LOW);    // Prepares latch 
digitalWrite(8, HIGH);   // Deactivates master reset

shiftOut(11, 13, MSBFIRST, highByte);    // shift data for OUT0-OUT7

digitalWrite(latchPin, HIGH);    // latch data

delay(1000);
    

}

It gives me the error: " 'highByte' was not declared in this scope. "

Thanks a lot!

It gives me the error: " 'highByte' was not declared in this scope. "

Well, that's true. In what scope did you define highByte? None is not the proper answer.

You need to clock out 16 bits, not 8.

I don't know how to define the highByte. That's the problem there!

I was trying to only do the first 8 bits to see if it would work to start with..

Thanks

I don't know how to define the highByte.

Why not? The name is NOT highFloat, highInt, highString, or highLong, so the type ought to be pretty damned obvious!

I really don't get forums :)

It's like you come and ask me how to make Pizza and I tell you: well it's just flour and tomatoes isn't it?

People are good at different things, people have had different time to learn different things.

t's like you come and ask me how to make Pizza and I tell you: well it's just flour and tomatoes isn't it?

It's pizza dough and tomato sauce. If you want to make pizza, but don't know how to make pizza dough, then you have a different question.

Here's your pizza dough.

byte highByte = 47;