Blinking LEDS using PIC16F84A

Discussion in 'Embedded Systems and Microcontrollers' started by mpjr23, Aug 3, 2012.

  1. mpjr23

    Thread Starter New Member

    Aug 3, 2012
    1
    0
    Hi! I'm a beginner in programming a PIC microcontroller using MPLAB and I have a hard time doing this project.
    The task is:
    Using a PIC16F84A, make a program that will enable the 7 LEDs to run with the following sequence:
    a.) LEDs are arrange in V-formation. The center LED blinks every 1sec and turns off every 1sec.
    b.) Both sides of the V turns on for 2sec and turns off for 2sec from the center going outward for 4cycles.
    c.) Stop for 2sec delay and repeats again.(center LED is not affected with stopping)

    I have already made the program for the 6LEDs on the side of the V-formation, but i don't know how to make the center LED blinks considering that it has a different timing compared to the 6LEDs.

    I hope you can help me..Thank you in advance..:)
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You must let the smallest interval control the larger ones. This is done using a counter. This is how it is done in say digital clock as an example. Let us say for simplicity that we want to make digital clock using second intervals as a time base. In order to get minutes you count up 60 seconds then you increment the minute value. And for the hour value you count up 60 minutes before incrementing
     
Loading...