Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Why won't this work? on: January 23, 2013, 03:28:22 pm
I have LDR connected to a 5V port on the arduino and the other leg on the LDR connected to ground and analog in put port "A0".
2  Using Arduino / Programming Questions / Re: Why won't this work? on: January 23, 2013, 03:22:21 pm
Heres the code for you guys to look at so you can help me:

int val = 0;

void setup() {
}

void loop () {
 
val = analogRead(0);

Serial.print(val);

}
3  Using Arduino / Programming Questions / Re: Why won't this work? on: January 23, 2013, 03:20:11 pm
Thanks !  But I am trying to make a LDR tell my computer the light level through the serial port.  And it won't display the light level when I click serial monitor.  What do I do to make it work?
4  Using Arduino / Programming Questions / Why won't this work? on: January 23, 2013, 03:07:48 pm
Why won't this code work.
There's an error and it says val was not declared in scope.


Here's the code:


void setup() {

int val = 0;

}

void loop () {
  
val = analogRead(0);

Serial.print(val);

}

5  Using Arduino / Programming Questions / Re: Help with uploading to uno on: January 23, 2013, 11:52:36 am
It works now!  And my arduino is not broken!  I just changed the serial port to /dev/cu.modem411 thats all! Thanks for your help!   smiley
6  Using Arduino / Programming Questions / Re: Help with uploading to uno on: January 21, 2013, 09:57:27 pm
I don't have any resistors in series with the LEDs.
7  Using Arduino / Programming Questions / Re: Help with uploading to uno on: January 21, 2013, 09:50:12 pm
Ok I guess that's bad I hope I didn't hurt my uno.  But I can't put any programs on it.
8  Using Arduino / Programming Questions / Re: Help with uploading to uno on: January 21, 2013, 09:17:28 pm
Yes
9  Using Arduino / Programming Questions / Re: Help with uploading to uno on: January 21, 2013, 09:10:40 pm
Would you tell us the steps you follow to do the upload?

What kind of Arduino are you using?

I assume you use a 220 ohm resistor in series with your LED's anode (longest wire) and the cathode (short LED wire) to GND (0volts).

It's Arduino Uno 1.0.3.  For steps, I verify and then hit the upload button.  The LED's start to blink and then I get the error message.  I have the ground connected to the negative leg on the LED's and each LED has a digital OUTPUT port connected to it.  There are 13 LED's.
10  Using Arduino / Programming Questions / Re: Help with uploading to uno on: January 21, 2013, 08:56:28 pm
Yes.  I had programs working on it yesterday.
11  Using Arduino / Programming Questions / Help with uploading to uno on: January 21, 2013, 08:45:19 pm
Hi, I have created a sketch and when I try to upload it to my uno my computer says: programmer is not responding  smiley-sad  I am only 12 years old and my Dad tried everything to get the program to upload to the uno.  I need help!   When I'm uploading the sketch the LEDs blink so I think its connected to my computer properly.  I tried everything to get it to work I even tried changing the serial port and it didn't work.

Here's the code I tried to upload when this happens incase it's causing this:


const int LED1 = 0;  // Set the digital pin for the LEDs.
const int LED2 = 1;
const int LED3 = 2;
const int LED4 = 3;
const int LED5 = 4;
const int LED6 = 5;
const int LED7 = 6;
const int LED8 = 7;
const int LED9 = 8;
const int LED10 = 9;
const int LED11 = 10;
const int LED12 = 12;
const int LED13 = 13;

void setup() {
 
pinMode(LED1, OUTPUT);  //Declare the pins that the LEDs are connected to
pinMode(LED2, OUTPUT);  //as "OUTPUTS"   
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(LED8, OUTPUT);
pinMode(LED9, OUTPUT);
pinMode(LED10, OUTPUT);
pinMode(LED11, OUTPUT);
pinMode(LED12, OUTPUT);
pinMode(LED13, OUTPUT);

}


void loop() {
 
digitalWrite(LED1, HIGH); 
delay(500);
digitalWrite(LED1, LOW);
digitalWrite(LED2, HIGH);
delay(500);

}
Pages: [1]