LED Marquee using CD4017B

LED Marquee using CD4017B

You can probably tell by now that I love marquee effects. My latest code example uses only a single pin on a Gadgeteer mainboard. Most people would use a bit shift register such as the 74HC595 for the effect. However, you can also use a very cheap CD4177B. It’s a 10 pin progressive output IC. So, every time you clock the chip, the output moves to the next pin. Once you hit pin 10, it wraps backs to pin 1. This makes is incredibly easy to create a marquee effect. You only need to provide power the chip and pulse the clock at the rate you want to move the LED light.

To be honest, there’s no need to use a microcontroller here. I also put the same thing together using a 555 timer instead.

 

Here’s a video of it working:

The wiring looks like this:

LED Marquee using CD4017B

 

I have a potentiometer to control the speed of the pulses. The timer changes it’s interval based on the potentiometer value and pulses the clock pin. This is pretty much the easiest project next to a simple blinking light one can do.

 

public partial class Program
{
    private DigitalOutput output;
    private Potentiometer potentiometer;
    GT.Timer timer = new GT.Timer(200);
    void ProgramStarted()
    {
        potentiometer = new Potentiometer(13);
        output = breadBoardX1.CreateDigitalOutput(GT.Socket.Pin.Three, false);
        button.ButtonPressed += button_ButtonPressed;
        timer.Tick += timer_Tick;
        Debug.Print("Program Started");
    }

    void timer_Tick(GT.Timer timer)
    {
        int milliseconds = (int)(potentiometer.ReadProportion() * 1000);
        timer.Interval = new TimeSpan(0,0,0,0,milliseconds);
        output.Write(true);
        output.Write(false);
    }

    private bool isStarted = false;
    void button_ButtonPressed(Button sender, Button.ButtonState state)
    {
        if (!isStarted)
        {
            timer.Start();
            isStarted = true;
        }
        else
        {
            timer.Stop();
            isStarted = false;
        }
    }
}

The LED Marquee using CD4017B code is here:

MarqueLightsCD4017B