thanks man you really are a life saver I am going to have an exam in my embedded class at 8:30 and watch this video at 7:00 I've got a lot from this. Now my exam will be well done!
@wag-on3 жыл бұрын
I remember doing this in primary school in 1985 on a C64 computer with some external device attached.I had to add up the binary values to have the lights switched on/off. I had it how you've got with 2 lights immediately swapping but the teacher got me to modify it so both lights were red before either set proceeded to green. Loved it - just wish I knew what that gadget was called?
@wannarockful2 жыл бұрын
a microcontroller SDK
@shmurga Жыл бұрын
I’m sorry but you didn’t #ratio
@AKGaming-sr5qm Жыл бұрын
Where u belong to means which country 😅
@reinsaris4 жыл бұрын
8:10 when i compile changeLights()" on line 22 gives an error 'expected ')' before ';' token'. does anyone knows how to fix this?
@MakeUseOf4 жыл бұрын
Have you ended all lines with ; ?
@reinsaris4 жыл бұрын
MakeUseOf I found out what i was doing wrong, after an earlier ‘{‘ I didn’t close it. Thank you for your reply!
@AviationMaker Жыл бұрын
red and yellow not turning on on sametime
@christiancasasos27713 жыл бұрын
yellow and red turn on before the green turns on
@hadireg4 жыл бұрын
nice video. for the dual traffic light as done so far, a simple wiring G1 with R2 ; O1 with O2 ; R1 with G2. the ports can still handle the current I guess.
@MakeUseOf4 жыл бұрын
Nice. Yeh, you can easily drive quite a few LEDs from a basic Arduino. Check out our ancient LED cube project: kzbin.info/www/bejne/qqK6cnZqndpqpM0
@guruprasadkulkarni6352 жыл бұрын
how can i add another 4 led to make traffic signal?
@brotherandsisterA.K3 ай бұрын
I don;t know but it is not working with switch
@AKGaming-sr5qm Жыл бұрын
Very good ur good teacher bhudau 😂
@IOTmug4 жыл бұрын
here I am it is me: ) Thanks for creating video about me :)
@davidd26614 жыл бұрын
i made it myself and it worked :)
@ahmedkahie60094 жыл бұрын
Nice Video, but do you know how to make a junction with four traffic lights. I have suceed with two lights but i don't know how to make with four.
@MakeUseOf4 жыл бұрын
Wouldn't that just be another set of each lights? Just a case of adding more LEDs to the same pins, you wouldn't need to adjust the coding, unless you wanted specific code for turning left/right stages?
@ahmedkahie60094 жыл бұрын
Thank you for the reply. Two are in a row and two in the bottom. I need to know how to make right left stages
@ahmedkahie60094 жыл бұрын
@MakeUseOf The code only works for two traffic Lights
@louisferreira10124 жыл бұрын
how does the arduino board know to start with only the green pin at high and then all other pins low for 15s???
@That_0ne_Guy4 жыл бұрын
because of magic
@pranabdeka2094 жыл бұрын
Can I buy this kit online
@habibsaliu62084 жыл бұрын
my red and green come up at d same time how do i fix dis
@galileib08icasiamcyruzstev454 жыл бұрын
You said 10 kohm resistor at 6:07 but the color band in the picture diagram show only 1 kohm resistor (brown,black,red)... 10 k ohm resistor should be brown, black, yellow
@darwinbelliard96644 жыл бұрын
does the code work on Matlab?
@onnio79983 жыл бұрын
You can make a counter feom 1 to 4, one up every 5 seconds for example. Then say that green is on when counter is 1, yellow is on when counter is 2 or 4 and red is on when counter is 3.
@MakeUseOf3 жыл бұрын
That's a good approach!
@stephanfouche73745 жыл бұрын
Can you pls do a fading light video
@alifsaifuddin61924 жыл бұрын
why use 6 resistor 220 when u just use 4 resistor in the video
@funasfriend1504 жыл бұрын
Could we extend the time duration of light
@AnthonyGoodley3 жыл бұрын
I just bought a real traffic light. As in a full size real stoplight. Could code like this be used to control the lights so that it doea more than just display all the lights on all the time?
@MakeUseOf3 жыл бұрын
In theory, yes, but it depends on how your traffic light is wired up. If it designed to show them all at once, it could be that there's only a single light source in there, with three different colored lenses. Alternatively, you could wire up your own LED light sources behind each section?
@AnthonyGoodley3 жыл бұрын
@@MakeUseOf I'll be picking it up in a few hours. I'll dig in and explore it more soon. I'm guessing it has 3 different light sources and that someone did a bit of rewiring so that all 3 lights stay on constantly.
@luomnguyenvan14795 жыл бұрын
Code ??
@flowerdefknows3 жыл бұрын
i remember doing this back in year 7
@dane72053 жыл бұрын
I followed your video & your written version. The Traffic Lights worked, until I installed the button & modified the sketch. Getting an Error Message "Error compiling for board Arduino Nano". I'm using a Arduino Nano. Any thoughts? Please
@josevaldivia99085 жыл бұрын
Could you connect this to an actual set of light bulbs and have it do the same thing?
@MakeUseOf5 жыл бұрын
Sure, but you'd need a relay if the lightbulbs are running on AC power, and I wouldn't suggest playing with AC power if this is your first Arduino project!
@BrianJennings-e8r Жыл бұрын
I manage to write the code for the two traffic lights and a single button to control them, took me a while to sort the code out though...
@irinaktersnigdha50832 жыл бұрын
Please provide the source code
@MakeUseOf2 жыл бұрын
Apologies, our theme broke the source code. Please check the link in the description in a few days, it should be working again soon.
@nickhale29005 жыл бұрын
I would love to create something along those line for a model railway signal triggered by an IR obstacle sensor but I have not got a clue how to modify the code.
@MakeUseOf5 жыл бұрын
This was my first project, having never touched an Arduino before. It's easy once you dive in!
@MelinyanisoMapi3 жыл бұрын
Question, can the same logic work for an station indicator e.g Indicator light change to Red, green or yellow based on a on a DB field, my db is MSSQL, i want to do this project and looking for some inspirations
@official_prxalloteyezhpdsi60092 жыл бұрын
Thank you very much
@enzo991_5 жыл бұрын
I know this is probably unrelated, but I've been trying to find a tutorial for a Verilog code that does this exact same thing, simulate a single traffic light using the LEDs on the FPGA board. Do you have any idea where I can find such a tutorial ?
@thad43425 жыл бұрын
AllInTheManual I’m looking for that as well
@JerryKillian4 жыл бұрын
I have the Elegoo Uno R3 starter it as well. However, I had some issues with the code. For some strange reason, the lights were not operating as described in the code. I ended up having to put the OPPOSITE values for on and off. example: void changeLights(){ // green off, yellow on for 3 seconds digitalWrite(yellow, LOW); digitalWrite(red, HIGH); digitalWrite(green, HIGH); delay(3000); If I did not enter the values of each pin, the LED would stay on if I wanted it off. I had hand-typed the code as you have it on your website, copied/pasted as well. but only got the desired results when I changed the values as given.Also, this always starts with yellow every time. I know, right? Strange, but true.
@shehnazmasarweh15262 жыл бұрын
I use the switch button for it And for code the “if” statement method