Go Down

Topic: Modifying the HWSerial to make other Framelength possible (Read 1 time) previous topic - next topic

Bouni

Hi,

I'm working on a modification of HWSerial of Arduino 1.0 to make it possible to select the framelength/parity/stopbits like this:

Code: [Select]
Serial.begin(9600,9,'E',2);

The setup of the Serial Port works fine now, but im not very familiar with cpp  (virtual methods, polimorphism, inheritance, etc.) :(
Why i do this is just because i want to port my working c version of a Vending Machine Interface to Arduino.
This MDB interface need 9,N,1 (which arduino does not support so far).

I want to overload the write method that it takes a uint16_t argument, but when i tried to overload the virtual write method in HWSerial i get compiler errors.
Is it correct that the HWSerial get the write method from print.cpp ?

Would be nice if anybody can tell me which function i have to overload to get this working :)

If my explanation is not detailed enough please tell me!

Elias


PaulS

Quote
Is it correct that the HWSerial get the write method from print.cpp ?

No. HardwareSerial gets the write() method from the Print class in Print.cpp (case matters, if you haven't figure that out, as do complete names).

Go Up