Show Posts
Pages: 1 [2] 3 4 ... 105
16  Using Arduino / Programming Questions / Re: Help concatenating *chars on: July 19, 2014, 10:10:20 pm
str needs to be declared as a character array with enough room to hold all the characters that you are storing, plus the null on the end. Try:
Code:
char str[24];

Also, this statement:
Code:
  strcpy (str,lineId);
is going to give you problems because lineId is not a string. Either change it to a string or use sprintf to convert it to a string.

Pete
17  Using Arduino / Programming Questions / Re: bitshift left (<<) gives unexpected results on: July 19, 2014, 03:53:31 pm
Code:
unsigned long BitShift = 1 << n;

The "1" is an integer constant which, by definition of the C/C++ language, is 16-bits.
You need to make it a long integer "1L". There are a couple of other places in your code where this occurs too.

Pete
18  Using Arduino / Sensors / Re: Default DS18S20 example returns perplexing results on: July 18, 2014, 08:52:49 pm
I have a Teensy 3 with 3 DS18B20 (with a 4.7k pullup). The example code in your first post correctly identifies each one and reads the temperature with no problem.

Pete
19  Using Arduino / Sensors / Re: GPS Module not working. on: July 17, 2014, 09:16:00 pm
You have wired the GPS Tx pin to pin 4 on the UNO but your code specifies pin 2 as the RXPIN. Try changing the code to this:
Code:
#define RXPIN 4

Pete
20  Using Arduino / Programming Questions / Re: problem in using interrupts on: July 17, 2014, 04:10:12 pm
Quote
the other lead of switch to 5v
That is why nothing happens when you press the switch. The pin is at 5V and you switch it to 5V.
Connect the other lead to GND.

Pete
21  Using Arduino / Programming Questions / Re: Equation giving different results on: July 17, 2014, 09:34:53 am
@James C4S: Rather than acknowledge that your statement was wrong and move on, your first response on the issue is an ad hominem attack. Classy.

Pete
22  Using Arduino / Sensors / Re: Default DS18S20 example returns perplexing results on: July 16, 2014, 10:15:08 pm
Quote
not using parasitic power
But the code does use parasite power. Change this:
Code:
ds.write(0x44, 1);
to this:
Code:
ds.write(0x44, 0);

Pete
23  Using Arduino / Audio / Re: Arduino midi drums, midi issue...... on: July 16, 2014, 10:24:04 am
I retract that comment. I realized after I had posted it last night, that it may not be obvious just how illegible yellow is. If you preview your post, the yellow shows up very clearly because the background colour used in a preview is not the same as that used in the final message.
You can edit your post (use the Modify option) and, if you must use a different colour at all (but why bother?), change the tag from color=yellow to something legible such as color=red.

But, please don't use yellow.

Pete
24  Using Arduino / Programming Questions / Re: Equation giving different results on: July 16, 2014, 10:10:29 am
The problem is that a newbie might interpret "the compiler guessed wrong" literally. I would have had no problem if the statement had been "the programmer guessed wrong".

Pete
25  Community / Website and Forum / Re: Forum Font on: July 15, 2014, 05:14:11 pm
Agreed. The text looks like it was written with a leaking fountain pen. I've had to increase the size of the font (Control +) so that letters such as 'e' and 'a' aren't almost illegible blobs.

Pete
26  Using Arduino / Audio / Re: Arduino midi drums, midi issue...... on: July 15, 2014, 05:02:54 pm
There should be a special place in hell reserved for people who post yellow text.

Pete
27  Using Arduino / Programming Questions / Re: Equation giving different results on: July 15, 2014, 04:06:18 pm
The language specification defines how a compiler must handle things like precedence of operators (e.g. a*b + c) and mixed mode operations (e.g. the result of an int * float) and all the other aspects of the language.
There would hardly be any point trying to write a program if the first time you compiled the statement "a = b/5;" the compiler guessed that the 5 was an integer and the next time it guessed that it was a float.

Pete
28  Using Arduino / Programming Questions / Re: Programme stuck in setup on: July 15, 2014, 11:27:23 am
There's only one String object in the code. Change this:
Code:
String hdrstr =
to this:
Code:
char * hdrstr =

Pete
29  Using Arduino / Programming Questions / Re: Programme stuck in setup on: July 15, 2014, 10:55:28 am
What does your debugging output tell you? It also might be worth telling us what it prints.

Pete
30  Using Arduino / Programming Questions / Re: Equation giving different results on: July 15, 2014, 10:42:11 am
Quote
the compiler sometimes make a bad guess on how to handle the overall calculation.

The compiler doesn't guess.

Pete
Pages: 1 [2] 3 4 ... 105