Re: Stop Light Design

From: Don Lancaster (don_at_tinaja.com)
Date: 03/28/05


Date: Mon, 28 Mar 2005 16:52:25 -0700

Mark Jones wrote:
> John Fields wrote:
>
>>On 28 Mar 2005 12:44:23 -0800, marketing@thejrcgroup.com wrote:
>>
>>
>>
>>>I have aquired an old street stop light. The problem I have is that
>>>all of the lights stay on when I plug it in. I would like to make the
>>>light squentially turn on and off green, yellow, red, green... Like a
>>>regular stop light. I would think this would be fairly simple and
>>>inexpensive to do, however, the guys at radio shack seem to think it
>>>would be rather difficult. Thanks for any help in advance.
>>
>>
>>Brute force quick and dirty:
>>
>>start: 555 #1 turns on and drives the red TRIAC and turns the red
>> light on for ever how long you want it to be on. When it times
>> out it stops driving the red TRIAC and turns on 555 #2, which
>> drives the yellow TRIAC and turns the yellow light on for ever
>> how long you want it to be on. When it times out it stops
>> driving the yellow TRIAC and turns on 555 #3, which drives the
>> green TRIAC and turns the green light on for ever how long
>> you want it to be on. When it times out it stops
>> driving the green TRIAC and turns on 555 #1.
>>
>> goto start.
>
>
>
>
> * PIC16F84 microcontroller: www.microchip.com - about $1.00
> * JAL compiler: www.groups.yahoo.com/jallist
> * PIC programmer: http://www.google.com/search?q=PIC+programmer
>
> JAL Code to (accurately) emulate the traffic light pattern:
>
> include 16f84_04 ; timings are 4MHz
> include jlib ; standard library
>
> pin_a0_direction = output ; configure pins A0-A2 as outputs
> pin_a1_direction = output
> pin_a2_direction = output
>
> forever loop ; endless loop
> pin_a0 = on ; RED light on
> delay_1s(8) ; wait 8 seconds
>
> pin_a0 = off ; RED light off
> pin_a2 = on ; GREEN light on
> delay_1s(15) ; wait 15 seconds
>
> pin_a2 = off ; GREEN light off
> pin_a1 = on ; YELLOW light on
> delay_1s(4) ; wait 4 seconds
>
> pin_a1 = off ; YELLOW light off
> end loop ; repeat ad nauseum

Can you say BASIC STAMP?

-- 
Many thanks,
Don Lancaster
Synergetics   3860 West First Street  Box 809  Thatcher, AZ 85552
voice: (928)428-4073 email: don@tinaja.com
Please visit my GURU's LAIR web site at http://www.tinaja.com


Relevant Pages

  • Re: stupid error doing my head it! (C programming)
    ... This loop either never runs or never stops. ... c is a const pointer to char, bufferis presumably of type char. ... Believe the compiler when it gives you an error. ...
    (comp.programming)
  • Re: Running a background task
    ... and Handle_Msg stops when the rendezvous is done. ... Handle_Msg will never proceed past the entry call. ... If I move the loop outside ...
    (comp.lang.ada)
  • Re: wierd standalone application behaviour
    ... initializes and starts executing but ... it starts slowing down and eventually stops. ... Speed up the loop. ...
    (comp.soft-sys.matlab)
  • Thread error??
    ... within a loop (part of some simulation work) and during running it stops and ... has 'address error' in the command window. ...
    (microsoft.public.vstudio.general)

Quantcast