B4R Question How to set serial port 1 to 9600 8E1

Gerardo Tenreiro

Active Member
Licensed User
Hello, I need to set the serial port 1 to 9600,8E1 and I don't see the way.
Can somebody help me.
thank you
 

candide

Active Member
Licensed User
in B4R, Serial1.Initialize(9600) Uses the default 8N1 configuration.

if you want something different, i think you have to use HardwareSerial.h in inline C
 
Upvote 0

Gerardo Tenreiro

Active Member
Licensed User
in B4R, Serial1.Initialize(9600) Uses the default 8N1 configuration.

if you want something different, i think you have to use HardwareSerial.h in inline C
thanks candido
Indeed I already found the solution.
I leave it here for future reference.

'Public SerialNative0 As Stream ' Puerto Serie 1



'#if C
'void SerialNative0(B4R::Object* unused)
'{
'::Serial1.begin(9600,SERIAL_8E1,3,1);
'b4r_main::_serialnative0->wrappedStream = &::Serial1;
'}
'#End If
(SerialNative0, "En_Newdata","En_Error")
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…