Hello,
Is there any way to define the board type in the sketch so I don't get surprising error messages when I switch between sketches designed for different boards but forget to choose the board type in the menu?
TIA
Hello,
Is there any way to define the board type in the sketch so I don't get surprising error messages when I switch between sketches designed for different boards but forget to choose the board type in the menu?
TIA
(deleted)
I too use comments at the start of the sketch to remind me what board type I'm working with. I typically start development on one type only, say a 328p type and once working and all the bugs out I will add the stuff to allow it also to operate with a mega board and I will then update the comments to reflect that. Not all sketches require changes to apply to different boards types, but that depends on the specific sketch being used. Use of direct port access commands is one example where it would apply.
Lefty
That sames like it would be a nice feature to add. Currently, the only two macros are for clock frequency (F_CPU) and for the "framework" version (ARDUINO).
Thanks for the replies.
I will use the comment idea. In this particular case I had been programming a Nano and then opened a Mega sketch and I was informed that A11 was undefined in this scope . It took a little head scratching to figure out what was wrong.