First, I would like to say hello to everyone on the forum! I'm new to Arduino.cc forum and to working on an Arduino. I have become quite infatuated with this little chip in a very small amount of time! However, I'm working on a little something, something and I came across a little bit of an issue. Now I don't know if it's the way the Arduino board is set up or if I'm doing something wrong, this is where I'm counting on you guys to clear this up a little for me. Just to make it easy to explain, let's say I have an LED on pin# 13 and another LED on pin# 12. When I write a basic code for them to blink it seems to only alternate blinking, both LEDs will only go one speed. So say:
This does not work as commanded. instead LED will run correctly and than once LED is off LED2 will blink once quickly. Why is it doing this? Is the Arduino able to run a voltage through two pins at the same time? For the project I'm working on I need two 2.5v - 5v rails for it to work but I need both of them to operate on their own and provide voltage at the same time. On the one rail is a relay that I would like to have timed to go on and off using the Arduino along with powering the other side of the project. Well let me know what you guys think it could be! Thank you in advanced!
I'll have to take a look into it... Thank you! Do you know anywhere that has a breakdown or specs per section of the Arduino? I was looking for something along the lines of that, but came up with nothing. I'm going to blame most of my issues to being ignorant to the Arduino. I'm sure, I will come along sooner or later. Again, thank you for the reply!
For some reason I don't think it did this last week when I got it, I ran the same script and I don't recall it doing that. As long as I know it's not something I did, but the unit itself messing up! On the other hand I just got this thing last week!
So, I just want to verify, that the Arduino Uno, should have no problem running 2 different pins at the same time, correct?
you aren't driving two leds at the same time. You are switching one on for one second, then switching it off. Then, one second later, you switch the second led on for 50 milliseconds, then switch that one off. That seems to me to agree with your observed results.
Because that is exactly what you told it to do in the code. A processor executies only one line at a time and does not move on to the next line until it has finished. Therefore delay will in effect do nothing for a set length of time. When that time is up it will go on to the next line.
Oh, okay! Well thank you for clearing it up for me! So as I figured, it's just an issue with what I'm doing. I had a feeling that was the case. Thank you for the help and the links guys! You saved me from ripping out more of my hair! Thanks again!