Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ShiftRegister74HC595.h>
- ShiftRegister74HC595<4>* sr;
- int t23[] = { 140, 300, 120, 600, 400 };
- int t0[] = { 150, 170, 160, 800, 190 }; // n'est pas utilisé ?
- uint8_t p23[][4] =
- {{B00000000,B00000000,B00000000,B00000000},
- {B10000000,B00010000,B10000000,B10000000},
- {B11000000,B00110000,B11000000,B11000000},
- {B11100000,B01110000,B11100000,B11100000},
- {B11110000,B11110000,B11110000,B11110000},
- {B11111000,B11110001,B11110000,B11111000},
- {B11111100,B11110011,B11111100,B11111100},
- {B11111110,B11110111,B11111110,B11111110},
- {B11111111,B11111111,B11111111,B11111111},
- {B00000000,B00000000,B00000000,B00000000},
- {B11111111,B00000000,B00000000,B00000000},
- {B11111111,B11111111,B00000000,B00000000},
- {B11111111,B11111111,B11111111,B00000001},
- {B11111111,B11111111,B11111111,B11111111},
- {B00000000,B00000000,B00000000,B00000000},
- {B11111111,B11111111,B11111111,B11111111},
- {B11111110,B11110111,B11111110,B11111110},
- {B11111100,B11110011,B11111100,B11111100},
- {B11111000,B11110001,B11110000,B11111000},
- {B11110000,B11110000,B11110000,B11110000},
- {B11100000,B01110000,B11100000,B11100000},
- {B11100000,B01110000,B11100000,B11100000},
- {B11000000,B00110000,B11000000,B11000000},
- {B10000000,B00010000,B10000000,B10000000},};
- int nt23, np23;
- void setAndDelay(ShiftRegister74HC595<4>& sr, uint8_t pattern[], int delayTime) {
- sr.setAll(pattern);
- delay(delayTime);
- }
- void setup() {
- sr = new ShiftRegister74HC595<4>(4, 2, 3);
- np23 = sizeof(p23) / sizeof(p23[0]); //
- nt23 = sizeof(t23) / sizeof(t23[0]); // ou nt23 = 5;
- }
- void loop() {
- for (int j = 0; j < nt23; ++j) {
- for (int i = 0; i < np23; ++i) {
- setAndDelay(*sr, p23[i], t23[j]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement