Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #15 on: December 14, 2012, 09:14:04 am » |
Yea, my mistake, I get the two confused all the time, sorry.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #16 on: December 14, 2012, 09:18:20 am » |
This is how i need the LEDs to glow
LANE1 LANE2 LANE3 LANE4 time green1 red2 red3 red 4 0 yellow1(2 sec) yellow2(2 sec) red 3 red 4 30 sec red1 green2 red 3 red 4 32 sec red1 yellow2 yellow 3 red 4 62 sec red1 red 2 green 3 red 4 64 sec red1 red 2 yellow 3 yellow 4 94 sec red1 red 2 red 3 green 4 96 sec
and the loop continues
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #17 on: December 14, 2012, 09:33:23 am » |
LANE1 LANE2 LANE3 LANE4 time green1 red2 red3 red 4 0 yellow1(2 sec) yellow2(2 sec) red 3 red 4 30 sec red1 green2 red 3 red 4 32 sec red1 yellow2 yellow 3 red 4 62 sec red1 red 2 green 3 red 4 64 sec red1 red 2 yellow 3 yellow 4 94 sec red1 red 2 red 3 green 4 96 sec
Not going to lie, that is kinda confusing. So you want a 30 sec delay between Grn and YEl, 2sec between Yel and Red and 30sec again between Red and Grn. is that right?
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #18 on: December 14, 2012, 09:38:43 am » |
no I want the green light to glow for 30 seconds. Then I want the yellow to glow for 2 seconds (Warning for a change from green to red).Then i need red to glow for 30 seconds.Then i want yellow to glow for 2 seconds (Warning for change from red to green)
What i have shown as a table is how a traffic light system at a 4 way junction will work.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #19 on: December 14, 2012, 09:42:06 am » |
Start simple, get one set (lane) to work properly, then invert the grn and red for the perpendicular side. You may need to adjust the delays.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #20 on: December 14, 2012, 09:44:04 am » |
A normal intersection goes grn - yel, yel - red, red - grn, why add the extra yel?
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #21 on: December 14, 2012, 09:45:57 am » |
K thanks
will you suggest an emulator for arduino.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 27
Posts: 1537
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #22 on: December 14, 2012, 09:52:06 am » |
The only emulator I know of is the one for the IPhone, and I dont know for sure if that will work like you want it to, I never tried it.
Also, Im at work right now and we dont allow WIFI, so I couldn't get it on my phone now if I wanted to.
You should look for a PC or MAC version, there has to be one.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 70
|
 |
« Reply #23 on: December 14, 2012, 09:57:27 am » |
want windows version but the one i downloaded is not working
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #24 on: December 14, 2012, 10:00:11 am » |
Firstly simple: use an array to indicate time and on/off status of led. Let's pick a number and its lowest 3 bits represent the 3 leds (RGY <->0bxyz), with '1' means on and '0' means off.
So your sequence is this:
0, 0b010, 0b100, 0b100, 0b100, //at time 0, lane 1's green is on, and lane 2..4's red is on 30, 0b001, 0b001, 0b100, 0b100, //at time 30, lane 1..2's yellow is on and lane 3..4's red is on 32, 0b100, 0b010, 0b100, 0b100, //at time 32, lane1's red is on, lane2's green is on, and lane3..4's red is on. ...
All you need to do in your code is to detect if the time has come to change the leds and then change them.
|
|
|
|
|
Logged
|
|
|
|
|
|