Show Posts
Pages: 1 2 3 [4] 5 6 ... 360
46  Using Arduino / Project Guidance / Re: program to find rpm on: July 29, 2014, 05:59:57 pm
Bulldog has the right of it. He keeps his units straight.

To scale from revs per second to revs per minute:
10 revs / 1 second =  ( 10 revs / 1 second ) * ( 60 seconds / 1 minute )
10 revs / 1 second = ( 10 revs * 60 seconds ) / ( 1 second * 1 minute ) = 600 revs / minute

To scale from revs per Y ms
X revs / Y ms = ( X revs / Y ms ) * ( 60000 ms / 1 minute )
X revs / Y ms = ( X revs * 60000 ms ) / ( Y ms * minute ) = X * ( 60000 ms / Y ms )  revs / minute
When Y = 5000, rpm = X * 12

47  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 29, 2014, 10:27:33 am
No problem, but I am still intrigued by the dynamic creation of the strings/Strings and not knowing how many there are.  Either the array will need to be declared large enough to hold the maximum number of strings to be created, in which case the sizeof() trick will not work, or declared just big enough to hold the strings in which case you will know how many of them there are.

You can do buffer management with C strings but by design, C++ Strings are a can of worms.
48  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 29, 2014, 10:22:47 am
Quote
LOL, what Arduino are you planning to run dynamic String arrays on?

you know you kinda come off as arrogant when you do this, lets say I don't know why running dynamic arrays is bad, instead of telling me why, you laugh in my face. I realize you're tired of answering newbie questions, but you could just ignore the whole thing if you don't want to deal with that. As it is you've contributed little to the whole discussion.

I realize dynamic strings are memory expensive, but it's not my choice to do it, all I needed to know is how to know how many entries there are and econjack has answered that with explicit detail. So thanks to him for answering the question.

Look, a number of people tried to reason with you and I did try an point out the obvious and I did give other information but you stepped on and over every bit of that and not just what I gave.

So fine, I'm looking at someone who knows better while being unable to understand why what he is trying Doesn't Work even as he misses and rejects true answers over and over on a quest to even more and bigger problems then get this...

I'm supposed to be arrogant for laughing about the futility that this person Insists Upon!

You blew through so much, you shouldn't toss the arrogant label much less play victim.
49  Using Arduino / Project Guidance / Re: Arduino UNO Pinout Diagram on: July 29, 2014, 07:32:48 am
MUCH Appreciated!
Karma to you! Perhaps others will follow suit.
50  Using Arduino / Project Guidance / Re: program to find rpm on: July 29, 2014, 07:22:15 am
i need to submit it to other person.... completely working program

How do you know?

Or is that a request for someone to hand you a complete solution immediately?

Damn, my set of that hardware must be in the same place as my mind reading cap.
I can look and look but you just know all those things will be in last place I look, never the first!
51  Using Arduino / Programming Questions / Re: Serial Monitor: garbish in output on: July 29, 2014, 06:15:36 am
Hi,

sorry for not mentioning: Arduino Mega 2560

Are there differences in serial behavior?

thx Alexander

Not that one. I don't have a Leonardo but I recall some wait-around with serial for those.

Another thing to check is serial monitor has the same speed (baud rate).

I sometimes get some screen trash on starting serial monitor but I can't remember any fix.
It usually precedes what my program sends.
So yes, I am interested too!
52  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 29, 2014, 12:17:20 am
I've gotten tired of telling new people why.
This one is so confident and maybe has a Due or will be really careful which kind of defeats the whole dynamic objects and container classes view.

It's bathtub on a bicycle time.
53  Using Arduino / Programming Questions / Re: multiple if or for loop with if inside on: July 28, 2014, 11:30:06 pm
In those cases it doesn't matter but

i = 5;

x = --i;  // i is pre-decremented here, i = i - 1 before i is copied to x
                // x is now 4 and i is now 4

y = i--; // i is post-decremented here, i = i - 1 after i is copied to y
               // y is now 4 and i is now 3
54  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 28, 2014, 11:25:10 pm
I could point out that if String arrays are to be created dynamically that counters can too but I'm waiting to see if when the other shoe drops the whole house doesn't come down soon after. But maybe it won't. Maybe an Arduino with lots of RAM will run it or only short strings and very limited arrays will be used.

I'd go with C strings and reuse of buffer space, see how much can stay in flash and think SD card.

55  Using Arduino / Programming Questions / Re: multiple if or for loop with if inside on: July 28, 2014, 11:12:31 pm
Break is a good solution to your stop variable, however as the code is fairly straight forward, we can do it with out any if statements at all:

Code:
char counterTest = 0;
for(int i = 16 ; i && array[i-1] ; --i, ++counterTest );

If you enable C++11 in IDE 1.5.7, you could also do this:
Code:
for( auto i : array ){
  if( i == LOW ) break;  
  ++counterTest;
}
Nice... could you point me where I could read an example of that for syntax? I don't understand the && array[i-1] and the comma before ++counterTest.

 i && array[i-1]  ..... the loop runs as long as this is true. && is a logical as opposed to bitwise AND

Look about halfway down the Reference on the left side for Boolean and Bitwise Operators
http://arduino.cc/en/Reference/HomePage

 --i, ++counterTest  ........ it's a comma separated list of actions done when the loop loops
56  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 28, 2014, 06:10:19 pm
the strings are not part of the code, this is just an example. They are being created in another part of the code and are variable.

i don't think (sizeof(myString) / sizeof(myString[0])) would work because sizeof(myString) returns 8

LOL, what Arduino are you planning to run dynamic String arrays on?
57  Using Arduino / Programming Questions / Re: Timer0 issue on: July 28, 2014, 06:06:56 pm
Quote
no, i don't

Not sure what you mean or if you know what I meant.

Due is an 84MHz Arduino. It will handle 0.25 us resolution if you don't try too much else.
http://arduino.cc/en/Main/ArduinoBoardDue
58  Using Arduino / Programming Questions / Re: How to share code? on: July 28, 2014, 05:59:22 pm
There's a lot of good stuff posted on The Playground as well.
Just how it gets there, I dunno.

Front door:
http://playground.arduino.cc/

Back door: (cue Jim Morrison)
http://playground.arduino.cc/Main/GeneralCodeLibrary
59  Using Arduino / Programming Questions / Re: Timer0 issue on: July 28, 2014, 05:43:09 pm
Not on time. And even then, the next IRQ runs immediately, repeat.

Get a Due?
60  Using Arduino / Programming Questions / Re: Serial Monitor: garbish in output on: July 28, 2014, 05:30:04 pm
Which Arduino are you using?
Pages: 1 2 3 [4] 5 6 ... 360