Show Posts
Pages: 1 ... 5 6 [7] 8 9 ... 273
91  Using Arduino / Programming Questions / Re: Programme stuck in setup on: July 15, 2014, 12:36:08 pm
Define what you mean by more powerful

More memory ?
Faster processor ?
More pins ?
More than one hardware serial port ?
etc, etc
92  Using Arduino / Programming Questions / Re: Programme stuck in setup on: July 15, 2014, 11:14:30 am
My best guess would be that you are running out of memory which will not be helped by the extensive use of String objects as opposed to C style strings.  As a first test reduce the length of hdrstr to a single character.  Do you get any different results ?
93  Using Arduino / Programming Questions / Re: Problem with 433Mhz rf link code on: July 15, 2014, 11:06:24 am
Code:
Serial.print((char)buf[i]);
94  Using Arduino / Programming Questions / Re: Problem with 433Mhz rf link code on: July 15, 2014, 07:55:51 am
You are getting the Hex value of the ASCII code for the letters.  No surprise really when you print the data using
Code:
    Serial.print(buf[i], HEX);
from a buffer defined as being an int rather than a char.
Code:
    uint8_t buf[VW_MAX_MESSAGE_LEN];
95  Using Arduino / Programming Questions / Re: Strange Interrupt Behaviour on attach on: July 15, 2014, 07:26:27 am
Code:
void vibration1() {
  vibration1Timer = millis();
  detachInterrupt(1);
}
Interrupts are automatically disabled when an ISR is triggered and enabled when the ISR has run.  The latter may be causing interrupts to be enabled at the end of the ISR.

Quote
The full sketch is quite long and take about 2 seconds to go through the loop
What is it that causes it to take 2 seconds each time through the loop() function ?

Without seeing what else your program does it is difficult to tell, but it is quite possible that you do not need to use an interrupt at all.
96  Using Arduino / Programming Questions / Re: who can tell me the "word" function defined in which library file? on: July 15, 2014, 06:00:33 am
If you can explain why you need to copy the function it may be possible that you do not need to do it ?
97  Using Arduino / Programming Questions / Re: another way of writing a counter on: July 14, 2014, 05:00:42 pm
It would help considerably if you would post your whole program and describe what you are trying to achieve.  The snippet of code posted is a waste of time without seeing it in context of the whole program.
98  Using Arduino / Programming Questions / Re: fireworks firing system 64 cue + on: July 14, 2014, 10:45:48 am
Your first task should be to post your existing code again but this time use code tags to avoid a large portion of it being turned into italics and destroying the array index when you use the variable i.

Your second task should be to post the new code that you have tried, again in code tags, and a description of what should happen when it runs, what actually happens when it runs and if it will not compile, what error messages you get.
99  Using Arduino / Programming Questions / Re: Read integer from multiple integers string on: July 14, 2014, 10:36:12 am
Quote
UKHeliBob made a small typo
Good spot Robin.

Now, of course, using Google you can search for the atio() function and find my post !
100  Using Arduino / Programming Questions / Re: Read integer from multiple integers string on: July 14, 2014, 06:05:12 am
Method 1 : Read the whole input into a string (Note NOT a String) then use the strtok() function to extract the piece that you want, delimited by semi-colons, then use the the atio() function to turn it into an integer.

Method 2 :Read the bytes as they arrive, count the semi-colons so that you know where you are and save the bytes that you want in a char array terminated by a null to turn it into a string, then use the the atio() function to turn it into an integer.
101  Using Arduino / Programming Questions / Re: GPIO help on: July 14, 2014, 02:46:43 am
Quote
I'm still wondering if the arduino uno can manage 12 separate inputs and 12 separate outputs.. It looks like there are less than 24GPIO pins on it.
Which Arduino are you looking at ?
The Uno has 20 input/output pins whereas the Mega has 70.
102  Using Arduino / Programming Questions / Re: Help me please position control motor code on: July 13, 2014, 11:06:32 am
You don't actually say what problem you have.

One thing I noticed are lines like this
Code:
    long error = (encoder0Pos*0.72) - target ;
and
Code:
volatile long encoder0Pos = 0;
The error and encoder0Pos variables are declared as a long which implies that their value could be between -2,147,483,648 and 2,147,483,647.  Do you need such large numbers ?

Also, in the first example line above you multiply encoder0Pos by 0.72 and put the result in a long integer, not a float.  This may not matter but it is probably not doing exactly what you think.
103  Using Arduino / Programming Questions / Re: Switch Control on: July 13, 2014, 01:27:42 am
How will c change when the while loop is preventing other code being executed ?
104  Using Arduino / Programming Questions / Re: Fail When It Have Too Many IF, ELSE IF?? on: July 12, 2014, 02:05:42 pm
Quote
However,when I comment some of it out everythings work fine!
That makes it sound suspiciously like you have a problem with shortage of memory and you do have some large arrays of ints in the program.
105  Using Arduino / Programming Questions / Re: Delay() function in setup() on: July 12, 2014, 03:01:10 am
You have my permission to use it.

[hint]
One thing that I like about the Arduino is how easy it is to try things for yourself.
[/hint]
Pages: 1 ... 5 6 [7] 8 9 ... 273