Go Down

Topic: How to get Arduino type? (Read 384 times) previous topic - next topic

canavaroski90

Hello everybody.

I'm working on a new project nowadays. I'm trying to get Arduino type and write it on LCD. For example;

"You'r using Arduino UNO" or "You'r using Arduino PRO" etc etc..

Is this possible?

Thanks, regards.

Grumpy_Mike


WizenedEE

You can do this to get the chip name:

Code: [Select]

#ifdef __AVR_ATmega1280
#ifdef __AVR_ATmega2560
#ifdef __AVR_ATmega128
#ifdef __AVR_ATmega8
//...


There might be a way to read a byte in the bootloader that is unique to each arduino bootloader, also.

Grumpy_Mike

As the def is only a compiler directive I don't see how this helps getting it off a board. The boot loader has no number describing the board it is on.

WizenedEE

The boot loader has no number describing the board it is on.


But you could distinguish between, say, the Uno and the Duemilanove by the actual bootloader -- the two bootloaders must be different in some way, and most boards have different bootloaders. It wouldn't be easy, but it's theoretically possible.

You can also use

Code: [Select]

#if F_CPU == 8000000
#if F_CPU == 16000000

Go Up