Go Down

Topic: programing plz help!!!!! (Read 1 time) previous topic - next topic

ilyuck

hey gyes im jake and i was wondering if i can program the ardunio with c++ in stead of c

thx in advanced

AWOL


ilyuck

not yet but i dont get were to learn about inputing the led lights and all that stuff do u kno?

AWOL

Have you read the manual?
Why not?

ilyuck

what manual are u talking about the one that came in the pack i got or the on on the internet
by the way i got the spark fun inventors kit

AWOL

You see up there on the left, where it says "Main site"?
Try clicking on it, and welcome to a new world.

(Are your shift and punctuation keys broken?)

ilyuck

can some one plz correct this code plz it is in c++ i think.
this code is supposedto make the 8 led light blink on and off in a row

int ledpins{2,3,4,5,6,7,8,9}
int main(){
  loop:
  int i;
while(i = 0 i < 8)
++i;{
pinMode(LedPins,OUTPUT);

}
}
if (i == 8) goto loop;
{
oneAfterAnotherLoop();
}
oneAfterAnotherNoLoop(){
  int delayTime = 100;
 
  digitalWrite(ledPins[0], HIGH);
 
  dellay(delayTime);
 
  digitalWrite(ledPins[7], HIGH);
 
  delay(delayTime);
 
  digitalWrite(ledPins[7], LOW;
}


AWOL

#7
Mar 30, 2011, 01:17 pm Last Edit: Mar 30, 2011, 01:22 pm by AWOL Reason: 1
You haven't got a "setup".
You need a setup to configure the pins you've declared incorrectly, as outputs.
Arduino doesn't have a "main".
Using "goto" isn't usually necessary in grown-up languages.

Quote
it is in c++ i think.

...but not as we know it, Jim

Why don't you work through some examples?


johnwasser

Look at the Blink example to get an idea of how to write that for Arduino.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

rowan

And by the why isn't goto bad programming practice?

ilyuck

thanks gyes this really helped me

Go Up