aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2008-05-10 05:02:09 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2008-05-10 05:02:09 +0000
commit03d7c9b846e0c915fce8ee171d2000dd80c9d258 (patch)
treef6233e0fd8e0b969f241accee8483c5d23b51b1a /libraries
parent5fa29a57bec20439e386824e4b1896a68e1c9e1d (diff)
Modified Matrix to work with MAX7221: changing latching from rising edge to falling edge.
Diffstat (limited to 'libraries')
-rwxr-xr-xlibraries/Matrix/Matrix.cpp12
1 files changed, 6 insertions, 6 deletions
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
}
/******************************************************************************