Skip to content

Instantly share code, notes, and snippets.

@buildcircuit

buildcircuit/cd4029.ino

Last active Jun 30, 2020
Embed
What would you like to do?
CD4029 up and down counter
// 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);
}
}
@buildcircuit

This comment has been minimized.

Copy link
Owner Author

@buildcircuit buildcircuit commented Jun 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment