Hi guys, another Q for my DUE
This bit of code works fine on a UNO but not on my DUE, why?
First, this is just some test code. I’m driving a 16 bit LED shift register , on the UNO it steps from 0 to 15. Notice the Remarked code //bitClear (testing[intByte],numberToDisplay); - this works fine on the UNO. its only REM out for the DUE
On the DUE, I would expect this code to work the same as the UNO, but it does not.
First I had to change the BitClear to bitWrite (testing[intByte],numberToDisplay,0); to get it to show up any LEDs and when the LEDs light they are sort of random.
What am I missing here?
The registers are MBI5026GN
void loop() {
for(int intByte =0; intByte<2; intByte++){
for (int numberToDisplay = 0; numberToDisplay < 8; numberToDisplay++) {
// take the latchPin High so
// the LEDs don't change while you're sending in bits:
bitWrite (testing[intByte],numberToDisplay,1);
for (int shifting = 1; shifting < 3; shifting ++){
digitalWrite(OE, HIGH);
digitalWrite(LE, HIGH);
shiftOut(dataPin, clockPin, MSBFIRST, testing[shifting]);
}
//take the latch pin LOW so the LEDs will light up:
digitalWrite(LE, LOW);
digitalWrite(OE, LOW);
// pause before next value:
delay(300);
bitWrite (testing[intByte],numberToDisplay,0);
//bitClear (testing[intByte],numberToDisplay);
}
}
}