I apologize for a relatively simple question, as I’m sure there might be a simple answer. I have been searching all day but have found nothing that suggests what might be wrong (perhaps a missing library?). I say this so you know I have been diligent in my search for an answer, but I’m at wits end. My sketch below shows Serial1.begin(4800,SERIAL_8E1), which is the format I must use on my serial bus. The compiler is throwing an error,
" Name_of_project.ino: In function ‘void setup()’: error: SERIAL_8E1 was not declared n this scope."
This indicates to me that the serial function does not support this variable or something is missing in the declaration, but what? Thanks in advance for your assistance.
When I use 0x26, the below error message comes up. It's not exactly the same but nonetheless still an error.
Arduino: 1.5.6-r2 (Windows XP), Board: "Arduino Due (Programming Port)"
_2W_B_Smoke_Test.ino: In function 'void setup()':
_2W_B_Smoke_Test:15: error: no matching function for call to 'USARTClass::begin(int, int)'
C:\Program Files\Arduino\hardware\arduino\sam\cores\arduino/USARTClass.h:41: note: candidates are: virtual void USARTClass::begin(uint32_t)
It's a Due. I didn't mention the microcontroller because last time I did they moved it to the Due forum. I wanted the most views possible.
Your problem is SPECIFICALLY related to the fact that you ARE using a DUE. The appropriate place for your question is in the DUE forum. It doesn't matter how many people read your post.
OK. I changed the board type under Tools to Mega just to see what would happen. It compiled with no errors. When I changed it back to Arduino Due (Programming Port), it throws the error. What gives? Does the Due not support this option?
It's a Due. I didn't mention the microcontroller because last time I did they moved it to the Due forum. I wanted the most views possible.
Your problem is SPECIFICALLY related to the fact that you ARE using a DUE. The appropriate place for your question is in the DUE forum. It doesn't matter how many people read your post.
Well, thanks for the advice. Now how about a solution? You evidently know what the problem is. Do you wish to help or no?
Turn on verbose mode for compilation. Select the Mega. Pay attention to the messages.
Notice, in particular, that HardwareSerial.cpp is compiled.
Now, select the DUE. Pay attention to the messages.
Now, change BOGUSCRAP_8E1, and verify again. Pay attention to the meeages.
sketch_may20a.ino: In function 'void setup()':
sketch_may20a.ino:3: error: no matching function for call to 'USARTClass::begin(int, int)'
On the DUE, Serial (and Serial1) is NOT an instance of HardwareSerial. It is an instance of another class. SERIAL_8E1 is a define statement in HardwareSerial.h, which is not even being included.
The solution? There isn't one. The USARTClass doesn't (yet) support all the options of the HardwareSerial class.
Thanks for the assistance. After much pain-staking research, I came across this patch to the issue that will evidently allow you to config the serial ports.