Show Posts
Pages: 1 ... 17 18 [19] 20 21 ... 285
271  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];
272  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.
273  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 ?
274  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.
275  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.
276  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 !
277  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.
278  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.
279  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.
280  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 ?
281  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.
282  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]
283  Using Arduino / Programming Questions / Re: Problems with servo motors and pots (Project 05 Mood Cue). on: July 12, 2014, 01:16:06 am
Please post details of your circuit as it is now.
284  Using Arduino / Programming Questions / Re: Problems with servo motors and pots (Project 05 Mood Cue). on: July 11, 2014, 04:33:47 pm
In the photograph the pot does not appear to be connected to anything and if the 3 pin lead at the far end of the board is the servo connection then that does not appear to be connected to anything either.
285  Using Arduino / Programming Questions / Re: Switch Control on: July 11, 2014, 12:30:25 pm
Code:
        while( c !=509){
         }
Unless c equals 509 when this while loop starts then it will never end.  What is it meant to do ?
Pages: 1 ... 17 18 [19] 20 21 ... 285