Show Posts
Pages: 1 2 3 [4] 5
46  Using Arduino / Programming Questions / Re: random led blink code check on: June 08, 2012, 03:10:26 pm
is this ok as i say i'm new to arduino i'm used to pic chips


    //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);
    //Turn off the LED
    digitalWrite(ranNum, LOW);  
47  Using Arduino / Programming Questions / random led blink code check on: June 08, 2012, 02:56:28 pm
hi all
 i got a simple code and have modified it myself just want some one to check if the code is ok
i'm new at this and still learning the 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(25,300);
    //Turn on the LED
    digitalWrite(ranNum, HIGH);
    delay(ranDel);
    //Turn off the LED
    digitalWrite(ranNum, LOW); 
}




thanks all
marko
48  Using Arduino / Project Guidance / what value of potentiometer ?? on: May 28, 2012, 09:10:31 am
hi all
in the bargraph example
http://www.arduino.cc/en/Tutorial/BarGraph
what is the value of the potentiometer,
it is not on the list of parts required
thanks
49  Using Arduino / Project Guidance / Re: led snowfall led's on: May 19, 2012, 03:53:26 pm
i have a mega arduino i'm powering the led with a seperate 12volt power supply 100 watts basically i need help with the sketch and what to use a relay of 12 banks or transistors the 4 standard 5mm leds will have only 20mw each x4 = 80mw all on at the same time x 8 or
i think i will use use    
ULN2803A
50  Using Arduino / Project Guidance / Re: led snowfall led's on: May 19, 2012, 03:40:34 pm
as with the With 40+ individually addressable LEDs in a tube. sorry should have made myself a little clearer im only wanting 12 banks of 4 leds in my project. maybe something like the nightrider led's but only one sided
51  Using Arduino / Project Guidance / led snowfall led's on: May 19, 2012, 03:03:34 pm
hi all again
need help with a simple led design but i havent got a clue where to start ( newbie) i have made some led tubes but i want them to look like snowfall like this

so where do i start ?
do i use a relay module ? transistors and where can i start for the sketch
i have an arduino mega.

thanks
marko
52  Using Arduino / Programming Questions / help adding 2 sketches together on: May 10, 2012, 02:14:24 pm
hi all
i have 2 sketches and i want then both to run together one after the other but i'm new to arduino so need help and instructions on how to compile the 2 together if i add the second to the bottom of the other i get
redefinition of void setup so i know i'm doing something wron but dont know what


first sketch


//    FILE: lightning.pde
//  AUTHOR: Rob Tillaart
//    DATE: 2012-05-08
//
// PUPROSE: simulate lighning POC
//
//
#define BETWEEN 2579
#define DURATION 43
#define TIMES 7

#define LEDPIN 13

unsigned long lastTime = 0;
int waitTime = 0;

void setup()
{
  Serial.begin(115200);
  Serial.println("lightning 0.0");

  pinMode(LEDPIN, OUTPUT);
}

void loop()
{
  if (millis() - waitTime > lastTime)  // time for a new flash
  {
    // adjust timing params
    lastTime += waitTime;
    waitTime = random(BETWEEN);

    for (int i=0; i< random(TIMES); i++)
    {
      Serial.println(millis());
      digitalWrite(LEDPIN, HIGH);
      delay(20 + random(DURATION));
      digitalWrite(LEDPIN, LOW);
      delay(10);
    }
  }
 
  // do other stuff here

second sketch

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 9;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(150);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(5000);               // wait for a second
}
53  Using Arduino / Project Guidance / Re: lightning simulation help on: May 09, 2012, 05:42:26 pm
not a problem arduino is new to me as i'm a pic man at heart and the answers i had confused me
54  Using Arduino / Project Guidance / Re: lightning simulation help on: May 09, 2012, 04:27:47 pm
vid here

http://s491.photobucket.com/albums/rr277/markosillypig/?action=view&current=DSCN1787.mp4
55  Using Arduino / Project Guidance / Re: lightning simulation help on: May 09, 2012, 04:02:37 pm
i used this circuit with an irl520n it works fine any one see any problems ?
a string of led's 900Ma
56  Using Arduino / Project Guidance / Re: lightning simulation help on: May 09, 2012, 12:47:32 pm
would the relay module do the job ?
i'm powering a 12volt led strip with 12 volts and just need something to do the switching
57  Using Arduino / Project Guidance / Re: lightning simulation help on: May 08, 2012, 04:08:18 pm
i have just tried to add this code to the bottom buttom of the one above

i have changed the code myself to blink like eyes


/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 9;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);    
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(150);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(5000);               // wait for a second
58  Using Arduino / Project Guidance / Re: lightning simulation help on: May 08, 2012, 03:52:29 pm
thats perfect dude many thanks will an irf530 do the job i have seen on other sites that there compatable with arduino
59  Using Arduino / Project Guidance / lightning simulation help on: May 08, 2012, 02:42:51 pm
hi all
i'm looking to find any thing in the forum about thunderstorms but no luck
i am wanting to simulate a thunderstorm with arduno mega nothing flashy just simple i want to drive a strip of led's 900Ma  any help would be appreciated with the code and what hardware to use ie relays or transistors and witch one to use i would like the simulation to work for 3 seconds and a 1 minute pause.

thanks all

marko
60  Using Arduino / Project Guidance / Re: wich arduino to purchace on: April 21, 2012, 06:37:02 pm
light o rama do a unit but its cheep but the software is rediculas in price
Pages: 1 2 3 [4] 5