circ-02: last led won't light up
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 5
- Joined: Tue Apr 16, 2013 9:57 pm
circ-02: last led won't light up
I did the circ 02 and downloaded the sketch, but the last Led doesn't light up. i tried troubleshooting the code to the best of my ability, which is not great. I changed leds around and checked the output of pin 9 with a voltmeter after I changed the on time so there was time to check the voltage. no voltage there on pin 9. then I changed the sketch to the simple blink sketch and changed the pin in that sketch to pin 9 and that works o.k. so for some reason pin 9 is not getting the signal. what's up??? thanks
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: circ-02: last led won't light up
Can you post a link to that please?I did the circ 02 and downloaded the sketch
-
- Posts: 5
- Joined: Tue Apr 16, 2013 9:57 pm
Re: circ-02: last led won't light up
It tells you in the instructions for circ-02 to go to http://ardx.org/code02.
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: circ-02: last led won't light up
Post a photo showing all your wiring.
-
- Posts: 5
- Joined: Tue Apr 16, 2013 9:57 pm
Re: circ-02: last led won't light up
The problem is that I don't know enough about programming and the program or "sketch" that they tell you to download is really confusing to me. I finally made my own program and it all worked as it should so there is nothing wrong with the Arduino or my wiring. In the program I wrote I had to write each line of program out, couldn't use any of the "shortcuts" they showed. This made for a long program and an awkward one, but it worked. for example, after each line that told an led to light, I had to write aline for the time delay and put in the value of time. Of course, this is awkward, because if I wanted to change that value, I would have to change it multiple time. I know there must be a better way, and I tried some things, but just couldn't get the program to compile. so I have to learn more about programming. thanks, Bill
-
- Posts: 5
- Joined: Tue Apr 16, 2013 9:57 pm
Re: circ-02: last led won't light up
AND, how do you post an image????
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: circ-02: last led won't light up
To post an image, use the "upload attachment" tab just below the message editing window.
Sounds like you need what is called a 'variable'. For example, in the code below, you can just change "onTime" and "offTime" in one place and it will apply everywhere within the loop():after each line that told an led to light, I had to write aline for the time delay and put in the value of time. Of course, this is awkward, because if I wanted to change that value, I would have to change it multiple time
Code: Select all
void loop()
{
int onTime = 1000;
int offTime = 500;
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(onTime ); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
delay(offTime ); // wait for a second
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(onTime ); // wait for a second
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(offTime ); // wait for a second
digitalWrite(4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(onTime ); // wait for a second
digitalWrite(4, LOW); // turn the LED off by making the voltage LOW
delay(offTime ); // wait for a second
}
-
- Posts: 5
- Joined: Tue Apr 16, 2013 9:57 pm
Re: circ-02: last led won't light up
I tried something like that, but it would not go through. kept giving me a message about the brackets, so obviously I am not doing something correctly. I tried changing the bracket positions, and other things, but could not get it to "compile" (is that the correct word?) I need to learn more about this programming language. It will just take time and study and I will get it. thanks. Bill
- adafruit_support_bill
- Posts: 88091
- Joined: Sat Feb 07, 2009 10:11 am
Re: circ-02: last led won't light up
You need to make sure that your brackets are balanced. For every '{' you must have a '}'.
A good reference for the Arduino language is here: http://arduino.cc/en/Reference/HomePage
A good reference for the Arduino language is here: http://arduino.cc/en/Reference/HomePage
Please be positive and constructive with your questions and comments.