Arduino Traffic Light Tutorial

  Рет қаралды 138,925

MakeUseOf

MakeUseOf

Күн бұрын

Пікірлер: 58
@Beni-c4b
@Beni-c4b Жыл бұрын
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-on
@wag-on 3 жыл бұрын
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?
@wannarockful
@wannarockful 2 жыл бұрын
a microcontroller SDK
@shmurga
@shmurga Жыл бұрын
I’m sorry but you didn’t #ratio
@AKGaming-sr5qm
@AKGaming-sr5qm Жыл бұрын
Where u belong to means which country 😅
@reinsaris
@reinsaris 4 жыл бұрын
8:10 when i compile changeLights()" on line 22 gives an error 'expected ')' before ';' token'. does anyone knows how to fix this?
@MakeUseOf
@MakeUseOf 4 жыл бұрын
Have you ended all lines with ; ?
@reinsaris
@reinsaris 4 жыл бұрын
MakeUseOf I found out what i was doing wrong, after an earlier ‘{‘ I didn’t close it. Thank you for your reply!
@AviationMaker
@AviationMaker Жыл бұрын
red and yellow not turning on on sametime
@christiancasasos2771
@christiancasasos2771 3 жыл бұрын
yellow and red turn on before the green turns on
@hadireg
@hadireg 4 жыл бұрын
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.
@MakeUseOf
@MakeUseOf 4 жыл бұрын
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
@guruprasadkulkarni635
@guruprasadkulkarni635 2 жыл бұрын
how can i add another 4 led to make traffic signal?
@brotherandsisterA.K
@brotherandsisterA.K 3 ай бұрын
I don;t know but it is not working with switch
@AKGaming-sr5qm
@AKGaming-sr5qm Жыл бұрын
Very good ur good teacher bhudau 😂
@IOTmug
@IOTmug 4 жыл бұрын
here I am it is me: ) Thanks for creating video about me :)
@davidd2661
@davidd2661 4 жыл бұрын
i made it myself and it worked :)
@ahmedkahie6009
@ahmedkahie6009 4 жыл бұрын
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.
@MakeUseOf
@MakeUseOf 4 жыл бұрын
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?
@ahmedkahie6009
@ahmedkahie6009 4 жыл бұрын
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
@ahmedkahie6009
@ahmedkahie6009 4 жыл бұрын
@MakeUseOf The code only works for two traffic Lights
@louisferreira1012
@louisferreira1012 4 жыл бұрын
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_Guy
@That_0ne_Guy 4 жыл бұрын
because of magic
@pranabdeka209
@pranabdeka209 4 жыл бұрын
Can I buy this kit online
@habibsaliu6208
@habibsaliu6208 4 жыл бұрын
my red and green come up at d same time how do i fix dis
@galileib08icasiamcyruzstev45
@galileib08icasiamcyruzstev45 4 жыл бұрын
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
@darwinbelliard9664
@darwinbelliard9664 4 жыл бұрын
does the code work on Matlab?
@onnio7998
@onnio7998 3 жыл бұрын
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.
@MakeUseOf
@MakeUseOf 3 жыл бұрын
That's a good approach!
@stephanfouche7374
@stephanfouche7374 5 жыл бұрын
Can you pls do a fading light video
@alifsaifuddin6192
@alifsaifuddin6192 4 жыл бұрын
why use 6 resistor 220 when u just use 4 resistor in the video
@funasfriend150
@funasfriend150 4 жыл бұрын
Could we extend the time duration of light
@AnthonyGoodley
@AnthonyGoodley 3 жыл бұрын
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?
@MakeUseOf
@MakeUseOf 3 жыл бұрын
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?
@AnthonyGoodley
@AnthonyGoodley 3 жыл бұрын
@@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.
@luomnguyenvan1479
@luomnguyenvan1479 5 жыл бұрын
Code ??
@flowerdefknows
@flowerdefknows 3 жыл бұрын
i remember doing this back in year 7
@dane7205
@dane7205 3 жыл бұрын
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
@josevaldivia9908
@josevaldivia9908 5 жыл бұрын
Could you connect this to an actual set of light bulbs and have it do the same thing?
@MakeUseOf
@MakeUseOf 5 жыл бұрын
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
@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...
@irinaktersnigdha5083
@irinaktersnigdha5083 2 жыл бұрын
Please provide the source code
@MakeUseOf
@MakeUseOf 2 жыл бұрын
Apologies, our theme broke the source code. Please check the link in the description in a few days, it should be working again soon.
@nickhale2900
@nickhale2900 5 жыл бұрын
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.
@MakeUseOf
@MakeUseOf 5 жыл бұрын
This was my first project, having never touched an Arduino before. It's easy once you dive in!
@MelinyanisoMapi
@MelinyanisoMapi 3 жыл бұрын
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_prxalloteyezhpdsi6009
@official_prxalloteyezhpdsi6009 2 жыл бұрын
Thank you very much
@enzo991_
@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 ?
@thad4342
@thad4342 5 жыл бұрын
AllInTheManual I’m looking for that as well
@JerryKillian
@JerryKillian 4 жыл бұрын
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.
@shehnazmasarweh1526
@shehnazmasarweh1526 2 жыл бұрын
I use the switch button for it And for code the “if” statement method
@BlessingMaripita-vu7tv
@BlessingMaripita-vu7tv 4 ай бұрын
I need help people please
@monstrousdemon4565
@monstrousdemon4565 5 жыл бұрын
👍🏼
@monstrousdemon4565
@monstrousdemon4565 5 жыл бұрын
👍🏼😡
@dlegendarypro
@dlegendarypro 4 жыл бұрын
lmao copyright
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
How Do Traffic Signals Work?
12:37
Practical Engineering
Рет қаралды 2,6 МЛН
The BEST Mechanical Display You've EVER Seen!!!
13:51
Tin Foil Hat
Рет қаралды 592 М.
How to Make Smart Traffic Light 🚦 with Arduino
9:17
Tech Technology Pk
Рет қаралды 16 М.
Уроки Ардуино. ПИД регулятор
28:57
Заметки Ардуинщика
Рет қаралды 489 М.
Arduino Robotics with No Coding Using XOD
11:44
MakeUseOf
Рет қаралды 19 М.
You can learn Arduino in 15 minutes.
16:34
Afrotechmods
Рет қаралды 10 МЛН
Arduino Projects - 12 GREAT Ideas for you!!!
9:00
ToP Projects Compilation
Рет қаралды 388 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН