From 03d7c9b846e0c915fce8ee171d2000dd80c9d258 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 10 May 2008 05:02:09 +0000 Subject: Modified Matrix to work with MAX7221: changing latching from rising edge to falling edge. --- libraries/Matrix/Matrix.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libraries/Matrix') diff --git a/libraries/Matrix/Matrix.cpp b/libraries/Matrix/Matrix.cpp index c86c4c9..2eb3e25 100755 --- a/libraries/Matrix/Matrix.cpp +++ b/libraries/Matrix/Matrix.cpp @@ -116,13 +116,13 @@ void Matrix::putByte(uint8_t data) // sets register to a byte value for all screens void Matrix::setRegister(uint8_t reg, uint8_t data) { - digitalWrite(_pinLoad, HIGH); // begin + digitalWrite(_pinLoad, LOW); // begin for(uint8_t i = 0; i < _screens; ++i){ putByte(reg); // specify register putByte(data); // send data } - digitalWrite(_pinLoad, LOW); // latch in data - digitalWrite(_pinLoad, HIGH); // end + digitalWrite(_pinLoad, HIGH); // latch in data + digitalWrite(_pinLoad, LOW); // end } // syncs row of display with buffer @@ -132,13 +132,13 @@ void Matrix::syncRow(uint8_t row) // uint8_t's can't be negative, so don't test for negative row if (row >= 8) return; - digitalWrite(_pinLoad, HIGH); // begin + digitalWrite(_pinLoad, LOW); // begin for(uint8_t i = 0; i < _screens; ++i){ putByte(8 - row); // specify register putByte(_buffer[row + (8 * i)]); // send data } - digitalWrite(_pinLoad, LOW); // latch in data - digitalWrite(_pinLoad, HIGH); // end + digitalWrite(_pinLoad, HIGH); // latch in data + digitalWrite(_pinLoad, LOW); // end } /****************************************************************************** -- cgit v1.2.3-18-g5258