Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WEMOS_Matrix_LED.h>
- byte nums[] =
- {
- B11100000, //-- 0
- B10100000,
- B10100000,
- B10100000,
- B10100000,
- B10100000,
- B10100000,
- B11100000,
- B00100000, //-- 1
- B00100000,
- B01100000,
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B11100000, //-- 2
- B00100000,
- B00100000,
- B11100000,
- B10000000,
- B10000000,
- B10000000,
- B11100000,
- B11100000, //-- 3
- B00100000,
- B00100000,
- B11100000,
- B00100000,
- B00100000,
- B00100000,
- B11100000,
- B10100000, //-- 4
- B10100000,
- B10100000,
- B11100000,
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B11100000, //-- 5
- B10000000,
- B10000000,
- B11100000,
- B00100000,
- B00100000,
- B00100000,
- B11100000,
- B11100000, //-- 6
- B10000000,
- B10000000,
- B11100000,
- B10100000,
- B10100000,
- B10100000,
- B11100000,
- B11100000, //-- 7
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B00100000,
- B11100000, //-- 8
- B10100000,
- B10100000,
- B11100000,
- B10100000,
- B10100000,
- B10100000,
- B11100000,
- B11100000, //-- 9
- B10100000,
- B10100000,
- B11100000,
- B00100000,
- B00100000,
- B00100000,
- B11100000
- };
- byte workbyte[] =
- {
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000
- };
- byte matrix[] =
- {
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000,
- B00000000
- };
- byte d = B00000000;
- byte charlength = 4;
- int firstNum = 0;
- int maxRight = 11;
- int nChars = 2;
- MLED mled(1); //set intensity=5
- void setup()
- {
- Serial.begin(9600);
- mled.clear();
- }
- void loop()
- {
- int sh = 7; //-- shit right
- int shl = 0;//-- shift left
- charByte(firstNum);
- for(int x = 0; x < maxRight; x++)
- {
- for(int y = 0; y < 8; y++)
- {
- d = workbyte[y];
- if(sh < 0)
- d = d << shl;
- else
- d = d >> sh;
- matrix[y] = d;
- }
- for(int y = 0; y < 8; y++)
- {
- mled.disBuffer[y] = matrix[y];
- }
- mled.display();
- delay(70);
- if(x % 5 == 0)
- {
- //-- zde by me nabehnout druhy znak
- }
- sh--;
- if(sh < 0)
- shl++;
- }
- firstNum++;
- if(firstNum > (sizeof(nums) / 8) - 1 )
- firstNum = 0;
- }
- void charByte(int nChar)
- {
- int x = 0;
- for(int y = (nChar * 8); y < (nChar * 8) + 8; y++)
- {
- workbyte[x] = nums[y];
- x++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment