Show Posts
Pages: 1 2 [3] 4 5
31  Using Arduino / Programming Questions / Re: looking for a sketch for Close encounters of the third kind on: June 23, 2012, 03:53:42 pm
could this be feesable ???
32  Using Arduino / Programming Questions / looking for a sketch for Close encounters of the third kind on: June 22, 2012, 05:29:18 pm
hi all

i'm looking for a sketch for Close encounters of the third kind or somthing of the same kind a basic sketch would do as i can modify it myself any help would be appreciated could this be feesable ???
i dont need sound just the light sequence

cheers all
marko
33  Using Arduino / Project Guidance / Re: Tennis Ball Launcher on: June 20, 2012, 05:12:10 pm
some how i do not think this will work you could use the arduino to release the balls and control speed and direction
34  Using Arduino / Programming Questions / Re: adding random to sketch on: June 18, 2012, 05:37:19 pm
hi thanks
thats great it does not matter if each LED fades once
35  Using Arduino / Programming Questions / Re: adding random to sketch on: June 18, 2012, 05:12:31 pm
i want the led's to fade in a random pattern The order of pins
36  Using Arduino / Programming Questions / adding random to sketch on: June 18, 2012, 04:46:51 pm
hi all i have got this sketch but i want it to fade at random but i dont know where to put the random bit
any help would be appreciated i have the mega

Code:
/*
  Mega analogWrite() test
 
  This sketch fades LEDs up and down one at a time on digital pins 2 through 13.  
  This sketch was written for the Arduino Mega, and will not work on previous boards.
 
  The circuit:
  * LEDs attached from pins 2 through 13 to ground.

  created 8 Feb 2009
  by Tom Igoe
  
  This example code is in the public domain.
  
 */
// These constants won't change.  They're used to give names
// to the pins used:
const int lowestPin = 2;
const int highestPin = 13;


void setup() {
  // set pins 2 through 13 as outputs:
  for (int thisPin =lowestPin; thisPin <= highestPin; thisPin++) {
    pinMode(thisPin, OUTPUT);
  }
}

void loop() {
  // iterate over the pins:
  for (int thisPin =lowestPin; thisPin <= highestPin; thisPin++) {
    // fade the LED on thisPin from off to brightest:
    for (int brightness = 0; brightness < 255; brightness++) {
      analogWrite(thisPin, brightness);
      delay(2);
    }
    // fade the LED on thisPin from brithstest to off:
    for (int brightness = 255; brightness >= 0; brightness--) {
      analogWrite(thisPin, brightness);
      delay(2);
    }
    // pause between LEDs:
    delay(100);
  }
}


Moderator edit: [code] [/code] tags added.
37  Using Arduino / Programming Questions / Re: sketch error problems on: June 10, 2012, 04:37:33 pm
could some one fix the sketch for me and then i can print out both sketches and see what i'm doing wrong please
i hate been a newbee
38  Using Arduino / Programming Questions / Re: sketch error problems on: June 10, 2012, 04:16:29 pm
im here
sketch_jun09b.cpp: In function 'void loop()':
sketch_jun09b:35: error: 'ledPin' was not declared in this scope
so what is wrong now

// Random flasher by mark oldroyd
// Simple random number flasher
// generation and integration into your circuit on the
// arduino.
//
// Circuit build : Simply connect 8 LED's to pins 3,4,5,6,7,8,9,10
// Be sure to connect a resistor to each LED.  I used 330 ohms.
//
//
int ranNum;
int ranDel;
void setup() {
// Seed RNG from analog port.
randomSeed(analogRead(0));
// Setup 8 output ports for LED's
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
    //Generate random number between 8 and 10
    ranNum=random(3,11);
    // Generate random delay time
    ranDel=random(100,400);
    //Turn on the LED
    digitalWrite(ranNum, HIGH);
    delay(ranDel);
    // fade out from max to min in increments of 5 points:
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5)
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);       
    // wait for 30 milliseconds to see the dimming effect   
    delay(30);
}
39  Using Arduino / Programming Questions / sketch error problems on: June 09, 2012, 05:25:58 pm
can any one help fix sketch ??
still getting to know language
it keeps saying


sketch_jun09a.cpp: In function 'void loop()':
sketch_jun09a:35: error: 'ledPin' was not declared in this scope
sketch_jun09a:38: error: expected `}' at end of input


Code:

// Random flasher by mark oldroyd
// Simple random number flasher
// generation and integration into your circuit on the
// arduino.
//
// Circuit build : Simply connect 8 LED's to pins 3,4,5,6,7,8,9,10
// Be sure to connect a resistor to each LED.  I used 330 ohms.
//
//
int ranNum;
int ranDel;
void setup() {
// Seed RNG from analog port.
randomSeed(analogRead(0));
// Setup 8 output ports for LED's
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}
void loop() {
    //Generate random number between 8 and 10
    ranNum=random(3,11);
    // Generate random delay time
    ranDel=random(100,400);
    //Turn on the LED
    digitalWrite(ranNum, HIGH);
    delay(ranDel);
    // fade out from max to min in increments of 5 points:
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);        
    // wait for 30 milliseconds to see the dimming effect    
    delay(30);
}
Moderator edit: code tags added
40  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 05:07:33 pm
so how do i make them fade between each phase ?
41  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 03:51:09 pm
yas i read the page and got a little confused i have a mega so it should not be a problem to me
42  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 03:41:49 pm
so do not use pins 5 and 6
so could i use pins 2,3,4,7,8,9,10,11 ???
i'll get there in the end
43  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 03:36:11 pm
pins 6 to 13 ok ?
44  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 03:28:58 pm
yes im happy with the random bit i can modify it later
i would like it to fade between each phase but i'm not that good yet lol
45  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 03:21:20 pm
im looking to flash 8 led's in a slow random pattern possably fading between each flash
Pages: 1 2 [3] 4 5