You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to use the ESP8266 to control an iRobot Create 2 (via software serial). I can interact with the Create directly if I import this library into an Arduino sketch and upload to my Adafruit HUZZAH, however if I try to incorporate this code into another C++ class, I can send but not receive. Here is a trivial example:
// SSWrapper.cpp
#include"SSWrapper.h"
#include<inttypes.h>SSWrapper::SSWrapper() {
}
voidSSWrapper::begin() {
// just hard code in some values, because that's how I had it set up
softSerial = SoftwareSerial(12, 5, false, 64);
softSerial.begin(19200);
}
// these are just pass throughvoidSSWrapper::swWrite(uint8_t b) {
softSerial.write(b);
}
intSSWrapper::swRead() {
return softSerial.read();
}
intSSWrapper::swAvailable() {
return softSerial.available();
}
And finally, an Arduino Sketch:
#include<SSWrapper.h>
SSWrapper ssw;voidsetup(){
ssw.begin();}voidloop(){// now, the other side has sent some bytes to the ESP, so I expect ssw.swAvailable()// to be > 1, but it isn't, it's always 0.if(ssw.swAvailable()>0){byteinByte= ssw.swRead();
Serial.println("some data:");
Serial.println(int(inByte));}}
I also tried adding some debug code to the interrupt handler readRx function and it doesn't seem to be getting called.
The text was updated successfully, but these errors were encountered:
I've been trying to use the ESP8266 to control an iRobot Create 2 (via software serial). I can interact with the Create directly if I import this library into an Arduino sketch and upload to my Adafruit HUZZAH, however if I try to incorporate this code into another C++ class, I can send but not receive. Here is a trivial example:
And finally, an Arduino Sketch:
I also tried adding some debug code to the interrupt handler
readRx
function and it doesn't seem to be getting called.The text was updated successfully, but these errors were encountered: