Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Development / Re: Why wont this code work..... on: March 30, 2010, 08:38:21 pm
thanks it works great!!
2  Forum 2005-2010 (read only) / Development / Re: Why wont this code work..... on: March 29, 2010, 09:15:27 pm
Thank for the help!  But it don't shutdown after 10 blinks.
how could i make it do that?
3  Forum 2005-2010 (read only) / Development / Why wont this code work..... on: March 29, 2010, 08:58:51 pm
I am new to programming and i got this code off a form.
when i try to compile it says
 "C:\Users\Andy\Arduino\arduino-0018\hardware\arduino\cores\arduino/main.cpp:10: undefined reference to `loop'"


Code:
void setup()
{
  pinMode(13, OUTPUT); //set pin13 as an output so we can make the LED blink

  //do the next thing 10 times
  for(int i = 0; i < 10; i += 1)
  {
    //a blink is the LED turned on for X seconds, followed by it turned off for the same amount of time
    digitalWrite(13, HIGH);
    delay(1000);
    digitalWrite(13, LOW);
    delay(1000);
  }
}
4  Forum 2005-2010 (read only) / Development / Re: How to tell the arduino to... on: March 27, 2010, 06:27:00 pm
can u give my an example off my code, i still dont quite understand
5  Forum 2005-2010 (read only) / Development / Re: How to tell the arduino to... on: March 27, 2010, 06:10:58 pm
so hers the code i am curenty using how would i / can i tell it to do that for 10 times
Code:

int ledPin =  13;    // LED connected to digital pin 13
int led2Pin = 12;    // LED connected to digital pin 12
int ledGPin = 11;    // LED connected to digital pin 11
int ledRPin = 10;    // LED connected to digital pin 10

void setup()   {                
  // initialize the digital pin as an output:
  pinMode(ledPin, OUTPUT);
  pinMode(led2Pin, OUTPUT);
  pinMode(ledGPin, OUTPUT);
  pinMode(ledRPin, OUTPUT);
}

// the loop() method runs over and over again,
// as long as the Arduino has power

 void loop()                    
{
  digitalWrite(ledPin, HIGH);   // set the LED on
  delay(500);                  // wait for a second
  digitalWrite(ledPin, LOW);    // set the LED off
  delay(.5);                  // wait for a second
  digitalWrite(led2Pin, HIGH);   // set the LED on
  delay(500);                  // wait for a second
  digitalWrite(led2Pin, LOW);    // set the LED off
  delay(.5);                  // wait for a second
  digitalWrite(ledGPin, HIGH);   // set the LED o
  delay(500);                  // wait for a second
  digitalWrite(ledGPin, LOW);    // set the LED off
  delay(.5);                   // wait for a second
  digitalWrite(ledRPin, HIGH);   // set the LED o
  delay(500);                  // wait for a second
  digitalWrite(ledRPin, LOW);    // set the LED off
  delay(.5);                  // wait for a second
}
6  Forum 2005-2010 (read only) / Development / Re: How to tell the arduino to... on: March 27, 2010, 06:07:54 pm
yes i am new to this and i think with your help i get it
thanks alout!!
7  Forum 2005-2010 (read only) / Development / How to tell the arduino to... on: March 27, 2010, 11:22:32 am
Ok well first off i just got my arduino a few days ago  smiley-wink, and i am new to programming and circuit's .  So i was wondering how and if you can tell the arduino to lets say blink an LED 10 times?
 

Thanks Andy
8  Forum 2005-2010 (read only) / Development / How to tell the arduino to... on: March 27, 2010, 11:20:51 am
Ok well first off i just got my arduino a few days ago  smiley-wink, and i am new to progroming and circuit's .  So i was wondering how and if you can tell the arduino to lets say blink an LED 10 times?
 

Thanks Andy
9  Forum 2005-2010 (read only) / Exhibition / code for instructable on: March 30, 2010, 10:17:21 pm
Heres the code for this instructable http://www.instructables.com/id/Arduino-4-led-madness/
Code:
int ledPin =  13;    // LED connected to digital pin 13
int ledBPin = 12;    // Blue LED connected to digital pin 12
int ledGPin = 11;    // Green LED connected to digital pin 11
int ledRPin = 10;    // Red LED connected to digital pin 10

void setup()   {                
  // initialize the digital pin as an output:
  pinMode(ledPin, OUTPUT);
  pinMode(ledBPin, OUTPUT);
  pinMode(ledGPin, OUTPUT);
  pinMode(ledRPin, OUTPUT);


 for(int i = 0; i < 10; i += 1)
 {
  digitalWrite(ledPin, HIGH);   // set the LED on
  delay(500);                  // wait
  digitalWrite(ledPin, LOW);    // set the LED off
  delay(.5);                  // wait
  digitalWrite(ledBPin, HIGH);   // set the LED on
  delay(500);                  // wait  
  digitalWrite(ledBPin, LOW);    // set the LED off
  delay(.5);                  // wait for a second
  digitalWrite(ledGPin, HIGH);   // set the LED o
  delay(500);                  // wait
  digitalWrite(ledGPin, LOW);    // set the LED off
  delay(.5);                   // wait
  digitalWrite(ledRPin, HIGH);   // set the LED o
  delay(500);                  // wait
  digitalWrite(ledRPin, LOW);    // set the LED off
  delay(.5);                  // wait
    }
}
void loop(){}
Pages: [1]