PDA

View Full Version : Traffic Light Model



jeffrey morris
08-12-2005, 06:19 PM
There is a traffic light model (Volume 1, Column 26) but how can I create the circuit on the Home Work Board?

Tricky Nekro
08-12-2005, 07:12 PM
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--

dandreae
08-12-2005, 09:13 PM
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 (mailto:dandreae@parallax.com)
http://www.parallax.com

·

jeffrey morris
08-13-2005, 04:27 AM
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

dandreae
08-13-2005, 04:33 AM
I take it that everything is working okay?



Dave

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

Tech Support
dandreae@parallax.com (mailto:dandreae@parallax.com)
http://www.parallax.com

·

jeffrey morris
08-13-2005, 05:33 AM
Everything is working OK. I had to edit the code so that the traffic light works properly.