PDA

View Full Version : got my arduino!



blaze15301
03-10-2011, 05:35 PM
i got it today and ive had it for 4 hours. i wrote my firs led program. here is it f your intrested
// blinking led 1
#define LED 13 //led connected to 13
#define LED 12
#define LED 11

void setup ()
{
pinMode(13, OUTPUT); // pin as out put
pinMode(12, OUTPUT); // pin is output
pinMode(11, OUTPUT); // pin is output
pinMode(10, OUTPUT); //pin is output
pinMode(9, OUTPUT); // pin is output
pinMode(8, OUTPUT); // tunr led on
}


void loop()
{
digitalWrite(13, HIGH); // turns led on
delay(15); // wait a sec
digitalWrite(12, HIGH); // turns LED on
delay(25); // wait a sec
digitalWrite(11, HIGH); // tunr led on
delay(35); // wait a sec
digitalWrite(10, HIGH); // turn led on
delay(45); // wait a sec
digitalWrite(9, HIGH); // turn led on
delay(55); // waits for a second
digitalWrite(8, HIGH);// tunr led on
delay(65);

digitalWrite(13, LOW); // turn led off
delay(55);
digitalWrite(12, LOW); // tunrs LED off
delay(45);
digitalWrite(11, LOW); // turn led off
delay(35);
digitalWrite(10, LOW); // led off
delay(25);
digitalWrite(9, LOW); // led off
delay(15); // waits a seocnd
digitalWrite(8, LOW); // tunrs led off
delay(10);
}


i dont think its to bad considering ive never written anything in my life.

SXRguyinMA
03-10-2011, 07:48 PM
Also check out fritzing (www.fritzing.org). It lets you do up visual drawings to show how everything is hooked up, goes nice with your code :D

Enjoy it, if you've got any questions there's plenty of us here with experience, and also go to the Arduino forums (www.arduino.cc), and there's TONS more help there :up:

blaze15301
03-10-2011, 09:04 PM
Also check out fritzing (www.fritzing.org). It lets you do up visual drawings to show how everything is hooked up, goes nice with your code :D

Enjoy it, if you've got any questions there's plenty of us here with experience, and also go to the Arduino forums (www.arduino.cc), and there's TONS more help there :up:

thanks sxr you have been a big help. i need to grab a few things before i finish the book you sent me. so far ive learned a good it from it.

SXRguyinMA
03-10-2011, 10:10 PM
good, glad it helped you out!

blaze15301
03-10-2011, 10:24 PM
i broke the board already i think. the led wont stay on not even the onboard one.

x88x
03-10-2011, 10:33 PM
Is the input power good? If you connect it to your computer and try to program it, does it acknowledge it? .."Did you try turning it off and on again?" ;)

blaze15301
03-10-2011, 11:00 PM
Is the input power good? If you connect it to your computer and try to program it, does it acknowledge it? .."Did you try turning it off and on again?" ;)

yes yes and yes.

SXRguyinMA
03-10-2011, 11:16 PM
well if you can program it it's good, otherwise it'd come up with an error of some sort. did you change your coding at all?

blaze15301
03-10-2011, 11:47 PM
well if you can program it it's good, otherwise it'd come up with an error of some sort. did you change your coding at all?

yeah i checked it again i was missing a semicolon after one of my delays.

SXRguyinMA
03-11-2011, 12:40 AM
yea get used to those semicolons...they suck lol

x88x
03-11-2011, 01:26 AM
Damn semicolons...ruining everyone's day. :P

crenn
03-11-2011, 08:10 AM
Missing a semicolon usually results in the code not compiling, and it usually takes 10-15 seconds to fix! My recommendation, if you can't see what's wrong with the line it's pointing at, look at the 2 lines above that.

blaze15301
03-11-2011, 01:04 PM
Missing a semicolon usually results in the code not compiling, and it usually takes 10-15 seconds to fix! My recommendation, if you can't see what's wrong with the line it's pointing at, look at the 2 lines above that.

i didn't runt he compiler because i thought the code was the same one i already used but i think i accidentally hit the back button or something. thanks for the advice tho.

Oneslowz28
03-11-2011, 01:29 PM
Always pay attention to those error codes, and always verify via a compile.