Help traffic light system using PicBasic Pro


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Help traffic light system using PicBasic Pro

    After I thought about this for a while you really only need to control 6 LED outputs as North and South would be the same while East and West would be the same.

    I would suggest you use the low volume as the default configuration as it's easier to add time than to subtract time. You'd have to sit down and figure out how long you wanted the low volume to be on and how much you'd have added during medium and high volume.

    YOU would have to figure out how to sense volume using a timer of some sorts triggered by car movements. Don't forget PBP only does integers. Set a flag when it's medium volume and a different one when it's high. Use a CASE SELECT to choose which SUB to run.

    If you want to impress your professor I'd include a routine to check that NS and EW aren't the same. If they are then you should do the total flashing reds.

    Use a flow chart and it shouldn't be too difficult. Best wishes

  2. #2
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Re: Help traffic light system using PicBasic Pro

    Hi,

    And since you mention number of cars per minute I suggest you also look into DT's instant interupts so you can set up a real time clock that will run in the background to keep time for you. Easy? Not really but much easier than you would expect. It also depends a little bit on what PIC you will use for the project. Really tiny small ones when talking about memory size might not be up to the task.

  3. #3
    Join Date
    Apr 2013
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Help traffic light system using PicBasic Pro

    Quote Originally Posted by Jumper View Post
    Hi,

    And since you mention number of cars per minute I suggest you also look into DT's instant interupts so you can set up a real time clock that will run in the background to keep time for you. Easy? Not really but much easier than you would expect. It also depends a little bit on what PIC you will use for the project. Really tiny small ones when talking about memory size might not be up to the task.
    thanks for ur reply

    I use Pic 16F877a

  4. #4
    Join Date
    Apr 2013
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Help traffic light system using PicBasic Pro

    Quote Originally Posted by AvionicsMaster1 View Post
    After I thought about this for a while you really only need to control 6 LED outputs as North and South would be the same while East and West would be the same.

    I would suggest you use the low volume as the default configuration as it's easier to add time than to subtract time. You'd have to sit down and figure out how long you wanted the low volume to be on and how much you'd have added during medium and high volume.

    YOU would have to figure out how to sense volume using a timer of some sorts triggered by car movements. Don't forget PBP only does integers. Set a flag when it's medium volume and a different one when it's high. Use a CASE SELECT to choose which SUB to run.

    If you want to impress your professor I'd include a routine to check that NS and EW aren't the same. If they are then you should do the total flashing reds.

    Use a flow chart and it shouldn't be too difficult. Best wishes
    How NS & EW aren't the same ?

    and Is this relation right
    x= default time in ms
    n= number of car / 1 min
    f= factor

    T= x + n * f
    then in the program I write
    Pause T

    I do not have gd background in PicBasic Pro But I have to do this project
    I hope ur help

    and thanks you for your suggestion

Similar Threads

  1. conversion from picbasic to picbasic pro
    By winjohan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2011, 18:00
  2. PICBasic Pro vs. Proton Dev System
    By hjsong in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th February 2007, 04:17
  3. PICBasic Pro vs Proton PICBasic
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd November 2006, 16:11
  4. Get picbasic pro
    By Nicksterjack in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th March 2005, 12:14
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts