Show Posts
Pages: 1 ... 104 105 [106] 107 108 ... 300
1576  Using Arduino / Programming Questions / Re: 9V pin output id ? on: January 19, 2014, 04:24:18 am
"Diode Electro Luminescente" sounds so much better, especially when I say it out loud in my Peter Sellers "Inspector Clouseau" accent...   smiley-wink
1577  Using Arduino / Programming Questions / Re: How to undo a flipped state? on: January 19, 2014, 04:21:41 am
Quote
OK, so just adding "Serial.begin(9600);" to the setup screwed up the function of the whole sketch.
Adding the Serial.println("Boo"); screwed things up even more.

The code compiles correctly but when I run it on the Arduino it has a ton of unfavorable results.

Saying things were screwed up, or results were unfavourable, is of no use to anyone who may be trying to help.

I'm out, thanks for playing.

1578  Using Arduino / Programming Questions / Re: Storing multiple values and then take average on: January 19, 2014, 04:12:06 am
Until you have the average you won't know which readings to discard and then it's too late since you already used them to calculate the average which tells you to discard them.....

I use 100 for the number of readings on an LM35- even 1000 doesn't hold things up too long, and that minimises the effect of a few funnies like if there's an AC spike nearby or the dog farts, or whatever.
1579  Using Arduino / Programming Questions / Re: 9V pin output id ? on: January 19, 2014, 04:08:15 am
What's a DEL?

An LED?

Make sure you have a resistor in series....
1580  Using Arduino / Programming Questions / Re: 9V pin output id ? on: January 19, 2014, 03:51:05 am
If I understand it right, you have something across Vin and some other pin?

Well when the other pin is HIGH, the device will have no potential diff and be off; when the other pin is LOW, the device will have PD and be on.

So you make the other pin go high and low by setting it with pinMode once and then digitalWrites.

Vin doesn't have a pin number: it's not an I/O pin
1581  Using Arduino / Project Guidance / Re: can we replace the delay by an if on: January 19, 2014, 03:46:31 am
Code:
delay (someCondition ? trueDelayTime : falseDelayTime); 

THAT's going to spawn 5 more threads.....
1582  Using Arduino / Project Guidance / Re: can we replace the delay by an if on: January 19, 2014, 03:40:15 am
Quote
I suspect writing this is in vain, the OP will be onto the next thread soon

 smiley-grin

I suspect records are tumbling...
1583  Using Arduino / Project Guidance / Re: Calculating speed from millis() on: January 19, 2014, 03:33:00 am
diameter in meters / time in seconds = m/s

(230mm = .23m, of course)

Then m/s x 3600 gives m/h

And divide by 1000 to give km/h

So bottom line, speed in km/h is diam x 3.6 / seconds.

EDIT.... always assuming the beam is a radius up from the surface so it actually measures a diameter....
1584  Using Arduino / Project Guidance / Re: can we replace the delay by an if on: January 19, 2014, 03:26:06 am
Quote
check the blink without delay example
Woah Rob! This guy's used up a year's question quota in 12 hours, don't encourage anything which will invite more.....

I jest, of course.... OP you're welcome to ask as many questions as you like but I suspect you will soon stop getting answers since what you really ought to be doing, is read the reference, work the examples and search the playground
1585  Using Arduino / Project Guidance / Re: can we replace the delay by an if on: January 19, 2014, 03:20:07 am
I don't think so, but you could do it the other way round....

Code:
if (some condition or other is true) {
    delay(sometime);
}
// carry on....

EDIT.... as UKHB said.... smiley-cool
1586  Using Arduino / Programming Questions / Re: Delete EEPROM every time Arduino is turned ON on: January 19, 2014, 03:08:00 am
Quote
If you write to it more than a few hundred times,   it gets "worn out",  "ruined",   it won't work any more.

On that, and for my understanding since I was wondering some time ago, does all the EEPROM - even unused- get ruined together after a certain number or writes, or do the individual locations get zapped? (So that, if one only needed a handful of items to store, one could "scroll them" through all the loactions over time thus prolonging the life?)
1587  Using Arduino / Programming Questions / Re: Is there such a thing as fast Serial.println? on: January 19, 2014, 03:00:11 am
Take the Serial stuff out of the thing you're timing.

Code:
if (IR_Reciever.decode(&IR_Results))
  {
  }
  else
  {
// print "started"
// start the clock
    startCycle();
// stop the clock
//print elapse time
  }
}

1588  Using Arduino / Programming Questions / Re: does it work on: January 19, 2014, 02:54:09 am
Asking if code will work is a totally pointless thing to do: type it in and test it.

Only time I wouldn't do that is if a failure would be catastrophic, like accidentally setting off a nuclear weapon. But then I'd test it with an LED I suppose, or have it play a recording of a bomb.

Also, before you post, preview your typing to see if the tags actually worked.
1589  Using Arduino / Programming Questions / Re: Servo moves when not prompted to on: January 19, 2014, 02:48:50 am
you attached the servo but didn't give it a starting point. Not sure if this makes a difference, but try:

Code:
Servo myservo;
myservo.write (90);

With SSS, anything's worth a try.
1590  Using Arduino / Programming Questions / Re: How to undo a flipped state? on: January 19, 2014, 02:43:54 am

I had a feeling you knew what was hanging me up but were just not willing to point it out.



Not true.

I suggested the debug prints early on, since it seemed possible or even likely that the flow wan't actually going there, for whatever reason. I did point that out, that was a hunch, more than anything.

Then it struck me that the brackets looked wrong round about the time someone else did. I was however reluctant to waste my  further time when you thought that implementing my previous suggestion was wasting yours. But as it happens the bracket thing was being explained in another post at the same time.

Waste your time by all means- just don't waste mine.

Pages: 1 ... 104 105 [106] 107 108 ... 300