Hi all,
I'm attempting to create a menu ( with LCD screen ans push buttons ), to setup a serial ports with DUE.
My sketch works fine on Arduino MICRO, and I try to make it work on a DUE board.
To be simple, I use 3 arrays, to make choice-lists. One for all baudrates supported:
unsigned long baudRate[10] = { 300 , 600 , 1200 , 2400 , 4800 , 9600 , 19200 , 38400 , 57600 , 115200};
and two arrays for the confs supported (one for display to the user, one for serial config, as they share the same index):
char serialConfig[24] = { 0x00 , 0x02 , 0x04 , 0x06 , 0x08 , 0x0A , 0x0C , 0x0E , 0x20 , 0x22 , 0x24 , 0x26 ,
0x28 , 0x2A , 0x2C , 0x2E , 0x30 , 0x32 , 0x34 , 0x36 , 0x38 , 0x3A , 0x3C , 0x3E};
char* serialConfigString[24] = { "5N1" , "6N1" , "7N1" , "8N1" , "5N2" , "6N2" , "7N2" , "8N2" , "5E1" , "6E1" , "7E1" , "8E1" ,
"5E2" , "6E2" , "7E2" , "8E2" , "5O1" , "6O1" , "7O1" , "8O1" , "5O2" , "6O2" , "7O2" , "8O2"};
I store index for baudrate and config in this variables:
int baudRateChoice , serialConfigChoice;
Later, after the user has chosen his desired conf, I initiate the serial1 as follows:
Serial1.begin( baudRate[baudRateChoice] , serialConfig[serialConfigChoice] );
When I compile the sketch, I get an error message with the above line that I didn't get with Micro:
C:\Users\electronic\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.4\cores\arduino/USARTClass.h:112:10: note: no known conversion for argument 2 from 'char' to 'UARTClass::UARTModes'
call of overloaded 'begin(long unsigned int&, char&)' is ambiguous
I don't really understand the meaning of this ... and why what is OK with a board, fails with another ...
I guess there's some fundamental differences between AVR et SAM core, that my understanding and my skills cannot explain ...
Does anyone know how can I solve this issue (or force the compiler choice ) ?