Shop OBEX P1 Docs P2 Docs Learn Events
Traffic Light Model — Parallax Forums

Traffic Light Model

jeffrey morrisjeffrey morris Posts: 52
edited 2005-08-12 22:33 in BASIC Stamp
There is a traffic light model (Volume 1, Column 26) but how can I create the circuit on the Home Work Board?

Comments

  • Tricky NekroTricky Nekro Posts: 218
    edited 2005-08-12 12:12
    Yes, yes, yes. It's easy to make but difficult to programm.
    If am I right it is writen in PBasic 1.0. You have to convert it!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Rule your Destiny-
    --Be Good. Be Bad. Be Provas--
  • dandreaedandreae Posts: 1,375
    edited 2005-08-12 14:13
    The circuit uses LEDs with 1k resistors, since the Homework board has built in 220ohm resistors on the·I/O pins·I would change out the 1k resistors for ·470ohm resistors.· Since the LEDs are polarity sensitive you need to connect it as shown in figure 26.2.



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • jeffrey morrisjeffrey morris Posts: 52
    edited 2005-08-12 21:27
    Dave, Thanks for helping me create the circuit for the traffic light model. Here's the code:

    '{$STAMP BS2}
    '{$PBASIC 2.5}
    DEBUG "Traffic Light Model"
    DO
    HIGH 10
    PAUSE 500
    LOW 4
    HIGH 0
    PAUSE 1500
    LOW 0
    HIGH 2
    PAUSE 500
    LOW 2
    HIGH 4
    PAUSE 500
    LOW 10
    HIGH 6
    PAUSE 1500
    LOW 6
    HIGH 8
    PAUSE 500
    LOW 8
    LOOP
  • dandreaedandreae Posts: 1,375
    edited 2005-08-12 21:33
    I take it that everything is working okay?



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • jeffrey morrisjeffrey morris Posts: 52
    edited 2005-08-12 22:33
    Everything is working OK. I had to edit the code so that the traffic light works properly.
Sign In or Register to comment.