circ-02: last led won't light up

For makers who have purchased an Adafruit Starter Pack, get help with the tutorials here!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
jemezbill
 
Posts: 5
Joined: Tue Apr 16, 2013 9:57 pm

circ-02: last led won't light up

Post by jemezbill »

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

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: circ-02: last led won't light up

Post by adafruit_support_bill »

I did the circ 02 and downloaded the sketch
Can you post a link to that please?

jemezbill
 
Posts: 5
Joined: Tue Apr 16, 2013 9:57 pm

Re: circ-02: last led won't light up

Post by jemezbill »

It tells you in the instructions for circ-02 to go to http://ardx.org/code02.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: circ-02: last led won't light up

Post by adafruit_support_bill »

Post a photo showing all your wiring.

jemezbill
 
Posts: 5
Joined: Tue Apr 16, 2013 9:57 pm

Re: circ-02: last led won't light up

Post by jemezbill »

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

jemezbill
 
Posts: 5
Joined: Tue Apr 16, 2013 9:57 pm

Re: circ-02: last led won't light up

Post by jemezbill »

AND, how do you post an image????

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: circ-02: last led won't light up

Post by adafruit_support_bill »

To post an image, use the "upload attachment" tab just below the message editing window.
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
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():

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
}

jemezbill
 
Posts: 5
Joined: Tue Apr 16, 2013 9:57 pm

Re: circ-02: last led won't light up

Post by jemezbill »

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

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: circ-02: last led won't light up

Post by adafruit_support_bill »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Starter Pack”