//We always have to include the library #include "LedControl.h" //include this file so we can write down a byte in binary encoding #include /* Now we need a LedControl to work with. pin 12 is connected to the DataIn pin 11 is connected to the CLK pin 10 is connected to LOAD We have only a single MAX72XX. */ LedControl lc=LedControl(12,11,10,1); /* we always wait a bit between updates of the display */ unsigned long delaytime=100; void setup() { /* The MAX72XX is in power-saving mode on startup, we have to do a wakeup call */ lc.shutdown(0,false); /* Set the brightness to a medium values */ lc.setIntensity(0,5); /* and clear the display */ lc.clearDisplay(0); } void loop() { lc.clearDisplay(0); //1 voor 1 aan for( int col=0; col <= 7; col++) { for( int row=0; row <= 7; row++ ) { lc.setLed(0,col,row,true); delay(delaytime); } } // 1 voor 1 uit for( int col=7; col >= 0; col--) { for( int row=7; row >= 0; row-- ) { lc.setLed(0,col,row,false); delay(delaytime); } } //1 voor 1 aan heen for( int col=0; col <= 7; col++) { for( int row=0; row <= 7; row++ ) { lc.setLed(0,col,row,true); delay(delaytime); lc.setLed(0,col,row,false); } } // 1 voor 1 aan terug for( int col=7; col >= 0; col--) { for( int row=7; row >= 0; row-- ) { lc.setLed(0,col,row,true); delay(delaytime); lc.setLed(0,col,row,false); } } }