X-Git-Url: http://git.harvie.cz/?p=mirrors%2FPrograms.git;a=blobdiff_plain;f=arduino%2Fbomba-ledtest%2Fbomba-ledtest.ino;fp=arduino%2Fbomba-ledtest%2Fbomba-ledtest.ino;h=0000000000000000000000000000000000000000;hp=f0f9f7acf149253494e70f9ff8c501b2c87f5aeb;hb=de8021a10a2d637bb82fcfbf59ab419605f2ae0e;hpb=46a1695823fd4553a6f481c65b2594340d99dbc4 diff --git a/arduino/bomba-ledtest/bomba-ledtest.ino b/arduino/bomba-ledtest/bomba-ledtest.ino deleted file mode 100644 index f0f9f7a..0000000 --- a/arduino/bomba-ledtest/bomba-ledtest.ino +++ /dev/null @@ -1,68 +0,0 @@ -#include - -LedControl lc=LedControl(16,14,15,2); //datain, clk, load, number of chips - -/* we always wait a bit between updates of the display */ -unsigned long delaytime=250; - -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,15); //0 - 15 - /* and clear the display */ - lc.clearDisplay(0); -} - - -/* - This method will display the characters for the - word "Arduino" one after the other on digit 0. - */ -void writeArduinoOn7Segment() { - lc.setChar(0,0,'a',false); - delay(delaytime); - lc.setRow(0,0,0x05); - delay(delaytime); - lc.setChar(0,0,'d',false); - delay(delaytime); - lc.setRow(0,0,0x1c); - delay(delaytime); - lc.setRow(0,0,B00010000); - delay(delaytime); - lc.setRow(0,0,0x15); - delay(delaytime); - lc.setRow(0,0,0x1D); - delay(delaytime); - lc.clearDisplay(0); - delay(delaytime); -} - -/* - This method will scroll all the hexa-decimal - numbers and letters on the display. You will need at least - four 7-Segment digits. otherwise it won't really look that good. - */ -void scrollDigits() { - for(int i=0;i<13;i++) { - lc.setDigit(0,7,i,false); - lc.setDigit(0,6,i+1,false); - lc.setDigit(0,5,i+2,false); - lc.setDigit(0,4,i+3,false); - lc.setDigit(0,3,i+4,false); - lc.setDigit(0,2,i+5,false); - lc.setDigit(0,1,i+6,false); - lc.setDigit(0,0,i+7,false); - delay(delaytime); - } - lc.clearDisplay(0); - delay(delaytime); -} - -void loop() { - writeArduinoOn7Segment(); - scrollDigits(); -}