Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / Re: C++ question about alias element names in classes or structs on: February 23, 2014, 01:45:28 am
Quote
...define a common base class representing a value pair, and use that for the code that needs to deal with both types.

That's how it ended up. I haven't added the weird storage options I had in mind yet but it should be relatively painless.

Thanks all
2  Using Arduino / Programming Questions / C++ question about alias element names in classes or structs on: February 20, 2014, 02:24:59 am
So I have this nice class that handles a pair of values. Let's call them "a and b". Sometimes I want them to be coordinates, in which case I'd prefer the names "x and y". Other times I'd like them to be dimensions called "height and width". How can I do this without re-defining the class three times?

Thanks
Norm

3  Using Arduino / Installation & Troubleshooting / Re: What have I broken? on: October 03, 2013, 11:24:05 pm
It's obvious that the board healed. I knew a guy that had a Volkswagen that would do that.
4  Community / Website and Forum / Home page broken on: October 03, 2013, 09:53:52 pm
http://www.arduino.cc/ home page is illegible in my Firefox. Text is printing directly on top of pictures.

I just checked it in Internet Explorer and while the page is legible everything is in large fonts as though designed for sight impaired people.

Well, the forum won't let me delete this so let me amend it by saying that when I shut down and re-launched Firefox the site seemed to be working ok. I have no idea what happened or if there's any issue at all. The font size does seem a bit much but the page is clearly legible
5  Using Arduino / Installation & Troubleshooting / Re: 328 device signature on: September 08, 2013, 07:28:21 pm
I think I've got it beat. The chips had Uno boot loaders but I wasn't writing code for Unos so I tried to compile for Demi's. I never realized that 'Boards.txt' was about boot loaders, not boards.
6  Using Arduino / Installation & Troubleshooting / Re: 328 device signature on: September 08, 2013, 04:19:10 am
I can't find a device signature entry in there.  smiley-sad-blue
7  Using Arduino / Installation & Troubleshooting / 328 device signature on: September 07, 2013, 11:58:48 pm
I think the answer to this must be on the forum somewhere but I can't find it.

I seem to have bought some 328s in error and find I can't program them because of the different device signature from the 328P. Is there a way to make the Arduino IDE accept them? I know I could use AvrStudio but I'd rather not have to switch back & forth between IDEs.
8  Using Arduino / Programming Questions / Re: bug? on: August 20, 2013, 02:39:58 am
Ok, I guess you talked me out of using String. It's just that I've always hated having these buffers sitting around wasting space when not being used. Unfortunately it looks like String wastes way more memory and time than those buffers ever will.

The state machine is by far the coolest approach but it wants some very specific kinds of input and I want something more open ended.
9  Using Arduino / Programming Questions / Re: bug? on: August 20, 2013, 02:10:19 am
Your article looks very interesting I think it will be quite useful when I digest it.

I do think this is a bug.

char chr[] = "foo";
char chr2[] = "fu";
String str = "bar";
newString = chr + str; ---- works
newString = str + chr; ---- works
newString = str + str; ---- works
newString = chr + chr2; ---- fails - won't compile

Perhaps you should have to cast the char array to a String.
newString = String(chr) + str;

10  Using Arduino / Programming Questions / Re: bug? on: August 19, 2013, 10:55:59 pm
But Nick,
This...
Code:
stest = temp2 + temp3;
works where temp2 is a char array and temp3 is a string. If it only used the address of the char array it should be something like 12345two but it prints "onetwo"
11  Using Arduino / Programming Questions / bug? on: August 19, 2013, 09:34:41 pm
Am I just spacing out or is this a bug? You can't add two char arrays to make a string whereas you can add a String and a char array.
Code:
void setup() {
  Serial.begin(9600);
  char temp1[] = "test ";
  char temp2[] = "one";
  String temp3 = "two";
  String stest = "empty";
  //stest = temp1 + temp2;  // fail
  //stest = "test " + temp2;  // fail
  //stest = "foo" + "bar";  // fail
  stest = temp1;
  stest = temp2 + temp3;
}
12  Using Arduino / Programming Questions / Re: Bug in Time.h on: October 01, 2012, 07:15:52 pm
Doesn't dynamically allocated memory get freed when it goes out of scope? I think that how strings work, otherwise you'd need some kind of String.delete() function and Strings would really suck. I know you feel they suck anyway. Just sayin.

Time.h doesn't seem to be Arduino software. It's in the playground so perhaps I should be talking to the author.
13  Using Arduino / Programming Questions / Bug in Time.h on: September 30, 2012, 07:22:28 pm
It looks like the string functions in Time.h share a single output buffer so you may or may not get what you expect depending on timing.

Don't bitch about using sprintf(). You can reproduce the bug with Serial.print()

sprintf(adr,"%s, %s %u, %u", dayStr(weekday()), monthStr(month()), day(), year());

In this case the day of the week gets overwritten by the name of the month and prints "September September 30, 2012" If you reverse the calls the month will be overwritten by the day.
14  Using Arduino / Project Guidance / Re: Serve graphics with Eithernet Uno? on: April 26, 2012, 02:43:05 pm
The problem was that I was not sending the file length.

Thanks everyone.
15  Using Arduino / Project Guidance / Re: Serve graphics with Eithernet Uno? on: April 25, 2012, 05:55:06 pm
Thanks Nick.

Sigh. I think I'll just eliminate graphics from my server. It's not critical and the thing is already too fat. More code is not the way to go and I don't care for the idea of pre-converting the files.
Pages: [1] 2 3 4