CD4029 up and down counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic test of CD4029 up and down counter module | |
// Module designed by Sagar Sapkota from www.buildcircuit.net | |
void setup() { | |
pinMode(13, OUTPUT);// Connect pin 13 to CLK pinl | |
pinMode(12,OUTPUT); // Connect pin 12 to UD | |
//RESET THE COUNTER | |
// Connect Pin 11 of Arduino to RST Pin | |
pinMode(11,OUTPUT); | |
digitalWrite(11,HIGH); | |
delay(100); | |
digitalWrite(11,LOW); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
for (int i=0;i<10;i++) | |
{ | |
digitalWrite (12,HIGH); // Keeping pin 12 HIGH or UD pin HIGH will make the counter count UP | |
digitalWrite(13, HIGH); //Pulse high to CLK pin of CD4029 | |
delay(500); // wait | |
digitalWrite(13, LOW); // pulse low | |
delay(500); | |
} | |
for (int j=0;j<10;j++) | |
{ | |
digitalWrite (12,LOW); // Keeping pin 12 LOW or UD pin LOW will make the counter count DOWN | |
digitalWrite(13, HIGH); //Pulse high | |
delay(500); // wait | |
digitalWrite(13, LOW); // pulse low | |
delay(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.buildcircuit.net/cd4029