Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------
- void setup()
- {
- pinMode(2, OUTPUT);
- digitalWrite(3, LOW);
- }
- //------------------------
- void loop()
- {
- for (int i = 0; i < 24; i++) // 24 bits = 3 x HC595
- {
- BitOn();
- delay(50);
- }
- for (int i = 0; i < 24; i++) // 24 bits = 3 x HC595
- {
- BitOff();
- delay(50);
- }
- }
- //---------------------------
- void BitOn()
- {
- digitalWrite(2, LOW); // Down port
- delayMicroseconds(25); // bit On minimo 20 us maximo 70
- digitalWrite(2, HIGH); // Upper port
- delayMicroseconds(50); // Tempo minimo 50us
- }
- //---------------------------
- void BitOff()
- {
- digitalWrite(2, LOW); // Upper port
- delayMicroseconds(120); // bit off minimo 100 us maximo não tem
- digitalWrite(2, HIGH); // Upper port
- delayMicroseconds(50); // Tempo minimo 50us
- }
Add Comment
Please, Sign In to add comment