Show Posts
Pages: [1] 2 3 ... 45
1  Using Arduino / Microcontrollers / Re: Netduino vs Arduino on: June 14, 2012, 02:28:42 pm
You'll get more informed answers if you post on the Netduino forums instead of here on the Arduino forums.  The folks there will know their platform inside and out.
2  Using Arduino / Programming Questions / Re: invalid conversion from ‘const char*’ to ‘const int8_t*’ on: June 11, 2012, 08:27:27 pm

lcd_driver.cpp:24:20: error: invalid conversion from ‘const char*’ to ‘const int8_t*’
lcd_driver.cpp:24:20: error:   initializing argument 1 of ‘void LCD::prints(const int8_t*)’

Line 24 is the line with "const int8_t * ptr = string;".
Of course, I create a class (namely lcd) and call the function with lcd.prints("string");


Are you sure you have your line numbers right?  This is probably dying in the "lcd.prints("string")' line.

If you absolutely must do this, you can shut up the compiler thusly:

Code:
lcd.prints((const int8_t*)"string")

The better fix is to change the LCD class to not take int8_t*'s, which is somewhat absurd.
3  Using Arduino / Programming Questions / Re: What does this error mean and how doI fix it on: June 11, 2012, 08:14:26 pm
Look at it from the OP's perspective, though.  If a person does not know about loop(), they certainly do not know about main().  It's a one-line fix in the core to make loop optional.

Code:
void loop() __attribute__ ((weak)) {}
4  Using Arduino / Programming Questions / Re: What does this error mean and how doI fix it on: June 10, 2012, 11:58:26 pm
We should write up an issue on that.  Neither startup() nor loop() shouldn't be needed if you don't use them.
5  Using Arduino / Programming Questions / Re: Odd compiler error? on: June 07, 2012, 09:06:55 pm
Oh, and it looks like you are running Linux?  Open a command prompt and run "avr-gcc -v".  And while you're at it, "avr-as -v".  This will tell us which tools you're using.  Also, which version of which distro are you running?
6  Using Arduino / Programming Questions / Re: Odd compiler error? on: June 07, 2012, 09:00:39 pm
You can go ahead and post /var/folders/QT/QToGN6mK2RmPDU+1YrkbM++++TM/-Tmp-//ccbinRWR.s too.  Save it to pastebin if it's too large for the forum.
7  Using Arduino / Programming Questions / Re: Testing code without upload it? on: June 05, 2012, 09:18:12 pm
Having said that, I regard a debugger as a last resort, in a complex situation, where you simply can't work out why certain bizarre things are happening.

To each their own, eh...  For me, the debugger is the first thing I use if the problem is not immediately obvious.  Set a breakpoint where things are weird, inspect some memory, step through some code, fix the bug. That said, since the advent of test-driven development, my debugger use has plummeted.
8  Using Arduino / Programming Questions / Re: Testing code without upload it? on: June 05, 2012, 02:57:29 pm
It's hard to imagine disparaging a simulator once you've actually gotten used to running it.  Zero upload times.  Ability to test out sketches without even having hardware around (on a plane, in a coffee shop, at in-law's house).  Inspect pin values.  Set pin values, see what happens.  Step through code without having to bother with AVR Dragon (or tote one more fragile connection around).  My bug turnaround rate in software-only environment is something like 10x over running on hardware.
9  Using Arduino / Programming Questions / Re: How to upgrade the AVR-GCC toolset on a Mac? on: June 04, 2012, 11:48:37 pm
Crosspack is handy.  But it's getting a little old now.  It runs GCC 4.5.1, which is 18 months old.  In particular, 4.6.3 fixed many bugs, and improved code generation greatly.  If you're a bit brave, you can try rolling your own toolset.

I have proven step-by-step instructions for building 4.7.0 tools in Linux on my blog.  For Mac, it's not too much harder, there are just a couple extra steps to take care of first.

  • Install XCode, which has the gcc build tools
  • Install HomeBrew
  • Install GCC pre-requisites using homebrew: "brew install gmp mpfr libmpc"
10  Using Arduino / Microcontrollers / Re: Bobuino in design contest on: June 04, 2012, 10:44:34 pm
Good luck!
11  Using Arduino / Microcontrollers / Re: rebuild Mighty 1284P bootloader on: June 04, 2012, 10:43:09 pm
You will definitely get HEX files that are different.  The HEX from github is compiled with gcc 4.6.3 (I think) or 4.7.0.  It's safe to assume you're using a different version.  So the output will be different.  Should still work if it compiled without errors.
12  Using Arduino / Programming Questions / Re: Is it possible to use "new" to create an object in Arduino on: May 30, 2012, 10:32:05 pm
Code:
  int (*button)[3]; 
  int no=3;
  button = new int [no][3];


Oh one more thing.  This is completely legal.  The problem is that Arduino only included an implementation for ONE 'operator new'.  It does not include operator new[], which is needed for that operation.

You can add the missing new operators thusly:

Code:
inline void* operator new(std::size_t, void* p) {return p; }
inline void* operator new[](std::size_t, void *p) { return p; }
13  Using Arduino / Programming Questions / Re: Is it possible to use "new" to create an object in Arduino on: May 30, 2012, 10:07:13 pm
new and delete are not part of avr-gcc.

http://www.nongnu.org/avr-libc/user-manual/FAQ.html

1.0+ must have added support for them, external of avr-gcc, if they are working.

Rather...  They are not part of AVR-LIBC, which is absurd IMO.  Arduino added the basic new operator in 1.0.  Definitely they are part of avr-gcc.
14  Using Arduino / Microcontrollers / Re: Mega1248 with Steve Marple' bootloader on: May 30, 2012, 07:54:47 pm
And just to give credit where credit is due, the mighty-1284p bootloader is the latest WestFW-maintained optiboot including the changes needed to run on 1284.
15  Development / Suggestions for the Arduino Project / Re: min, max, abs.. are macroses? on: May 28, 2012, 05:01:17 pm
And if they annoy you, you can always #undef them out so they don't annoy again.
Pages: [1] 2 3 ... 45