Bug? rSoftwareSerial

newbie

Member
Licensed User
Longtime User
Hi,

i want try serial-connection between two arduinos with Erel's sample Code and two Due's
but is not possible to programm the Due-Board !
The same with a Uno works fine !!!

B4X:
Sub Process_Globals
  Public Serial1 As Serial
  Private astream As AsyncStreams
  Private led13 As Pin
  Private btn As Pin
  Private softserial As SoftwareSerial
End Sub

Private Sub AppStart
  Serial1.Initialize(115200)
  Log("appstart")
  led13.Initialize(13, led13.MODE_OUTPUT)
  led13.DigitalWrite(False)
  softserial.Initialize(57600, 10, 11)
  astream.Initialize(softserial.Stream, "astream_newdata", Null)
  btn.Initialize(btn.A0, btn.MODE_INPUT_PULLUP)
  btn.AddListener("Btn_StateChanged")
End Sub

Sub Btn_StateChanged (State As Boolean)
  Dim b As Byte
  If State Then b = 1 Else b = 0
  astream.Write(Array As Byte(b))
End Sub

Sub astream_NewData (Buffer() As Byte)
  Dim state As Boolean = Buffer(0) = 1 'state will be true if buffer(0) is 1.
  led13.DigitalWrite(Not(state))
End Sub

the compiler give me the following error

B4R version: 1.50
Parsing code. (0.00s)
Compiling code. (0.03s)
Building project (0.02s)
Compiling & deploying Ino project (Arduino Due (Programming Port) - COM8) Error
Konfiguration wird geladen...
Pakete werden initialisiert...
Boards werden vorbereitet...
Überprüfungs- und Hochladevorgang...
sketch\rSoftwareSerial.cpp: In member function 'void B4R::B4RSoftwareSerial::setListening(bool)':
rSoftwareSerial.cpp:27: error: 'class SoftwareSerial' has no member named 'stopListening'
serial->stopListening();
^
exit status 1
'class SoftwareSerial' has no member named 'stopListening'
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…