trying to unset LED... not jet woring

spi
polymurph 3 years ago
parent 7b457d4643
commit ec3fad9a7b

@ -95,6 +95,17 @@ void max7219_ledMatrixSetLED(
spiWriteReg(display->spiCH, row,col);
}
void max7219_ledMatrixUnsetLED(
max7219_t *display,
uint8_t row,
uint8_t col)
{
row = (row & 0x07) + 1;
col = 1 << (col & 0x07);
// TODO: find out how to turn off LED
spiWriteReg(display->spiCH, row,col+1);
}
void dispTest(max7219_t *disp)
@ -245,7 +256,7 @@ int main(int argc, char *argv[])
max7219_shutdownDiaply(&ledMatrix,0);
max7219_setDecodeMode(&ledMatrix, NO_DECODE_DIGIT_7_TO_0);
max7219_setScanLimit(&ledMatrix, DSIPLAX_DIGIT_7_TO_0);
max7219_setIntensity(&ledMatrix,0x01);
max7219_setIntensity(&ledMatrix,0x0F);
max7219_ledMatrixSetLED(&ledMatrix,0,0);
delayMs(1000);
@ -256,15 +267,25 @@ int main(int argc, char *argv[])
delayMs(100);
}
*/
while(1) {
max7219_ledMatrixSetLED(&ledMatrix,1,1);
delayMs(100);
max7219_ledMatrixUnsetLED(&ledMatrix,1,1);
delayMs(100);
}
while(1) {
for(i=0; i < 0x8; i++) {
max7219_ledMatrixSetLED(&ledMatrix,i,i+j);
//delayMs(20);
delayMs(100);
}
delayMs(50);
//delayMs(10);
j++;
if(j > 7) j =0;
}
/*
while(1){

Loading…
Cancel
Save