Show Posts
Pages: 1 ... 104 105 [106] 107 108 ... 304
1576  Using Arduino / Programming Questions / Re: Two LEDs with seperate timings - how? on: January 22, 2014, 10:47:05 am
Quote
Nick Gammon’s second code seems simpler to understand

That's because this part....

Code:
#include <LedFlasher.h>

.... basically does all the work for you.

These lines...

Code:
LedFlasher floodLight (8, 200, 300);
LedFlasher shuttleBayDoors (9, 300, 600);
LedFlasher impulseEngine (10, 900, 100)

.... all use LedFlasher() which is a function created inside LedFlasher.h, and the include makes that function available to you. It wouldn't surprise me in the slightest if Nick's LedFlasher internally used state machines to do the work. So I'm pretty sure, Nick's approach will be similar to the video, but insulating you from the drudge by bringing it to you in an include.
1577  Using Arduino / Programming Questions / Re: Two LEDs with seperate timings - how? on: January 22, 2014, 10:19:06 am
hey bud.

Can we have a link to Jasmine's video?

A few replies up ^ there
1578  Using Arduino / Programming Questions / Re: Two LEDs with seperate timings - how? on: January 22, 2014, 10:10:25 am
Nah, don't even think of doing it with delays.

Watch jasmine's video, understand a state machine, and you're set for life.
1579  Using Arduino / Programming Questions / Re: Two LEDs with seperate timings - how? on: January 22, 2014, 10:01:15 am
Two LED state machine

1580  Using Arduino / Programming Questions / Re: Two LEDs with seperate timings - how? on: January 22, 2014, 09:42:54 am
Blink without delay
1581  Using Arduino / Installation & Troubleshooting / Re: How to find MAC addres ?? on: January 22, 2014, 07:42:14 am
Just make one up- as long as it's unique on the lan-side you'll be fine.

Most people use DEADBEEFFEED- easy to remember.  smiley-cool
1582  Community / Website and Forum / Re: Controlling a Digital Potentiometer Using SPI (broken picture) on: January 22, 2014, 06:59:20 am
but still cut off in Chrome?!

Nope... good for me in Chrome
1583  Using Arduino / Programming Questions / Re: Counters to count no of times the loop entered and to reset it when i give a i/p on: January 22, 2014, 06:26:06 am
Quote
If it reset to zero means is there any solution to retain the previous values...??

EEPROM, perhaps?

Is your coffee machine going to be HTCPCP RFC2324 compliant?  smiley-twist
1584  Community / Products and Services / Re: CE declaration on: January 22, 2014, 05:51:27 am
Have you looked at the back of your Arduino?
http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Back.jpg

But it might be one of these.... I don't see a CE on there.
1585  Using Arduino / Storage / Re: Can only write limited number of lines to SD card - why? on: January 22, 2014, 05:43:38 am
What may be confusing the OP, and btw I'm no guru at this stuff, is that a String spelt deliberately with capital-S is not the same as a  string, small-s.

Both are explained in the Reference
1586  Using Arduino / Motors, Mechanics, and Power / Re: Useless box servo problems on: January 22, 2014, 04:11:15 am
The current never goes above 500mah

That would be mA  smiley-cool
1587  Using Arduino / Motors, Mechanics, and Power / Re: Useless box servo problems on: January 22, 2014, 03:58:55 am
No, that would be insane. smiley

.... but common. The tutorial is to blame since it instructs that way.

Quote
external power 6V, 1A.

When the fault happens, are all servos in action? Wisdom on the forum is to budget 1A per servo, so could it be that your 1A is exceeded?
1588  Using Arduino / Programming Questions / Re: My code only works when observing! on: January 22, 2014, 03:54:43 am
Quote
My code only works when observing!

I have colleagues like that.
1589  Using Arduino / Sensors / Re: How to sense/detect/measure water levels on: January 22, 2014, 12:42:14 am
When I was looking into this some years back, I found that some guy had patented sticking 2 wires in the water and taking one side to a transistor base to switch a beeper..... I can't find it now. I thought a patent had to be non-obvious to someone of similar standing. Using a transistor to amplify a signal, is surely what transistors are for?

[barney]True story[/barney]
1590  Using Arduino / Project Guidance / Re: Switch Code by with Button or Switch on: January 21, 2014, 10:31:34 pm
Have a look at while

Put your switch on a digital pin, and test it as the while's expression. Do what's in the while when the switch is one way, and what's below the while when it's the other.

Code:
void setup() {
pinMode(thePin, HIGH_PULLUP);
}

void loop(){
while (digitalRead(thePin) == HIGH) {
    // do one set of stuff
  }

//do the other stuff
}
Pages: 1 ... 104 105 [106] 107 108 ... 304