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
Hellow.
On Arduino UNO i read data(use FTD library) like this
StringBuilder mText = new StringBuilder();
FTDriver mSerial = new FTDriver((UsbManager)getSystemService(Context.USB_SERVICE));
PendingIntent permissionIntent = PendingIntent.getBroadcast( this, 0,
new Intent(ACTION_USB_PERMISSION), 0);
mSerial.setPermissionIntent(permissionIntent);
int i,len;
byte[] rbuf = new byte[4096];
len = mSerial.read(rbuf);
if (len>0){
for(i=0; i<len; i++) {
mText.append((char) rbuf[i]);
}
It's work great.
But when i try read data use PhysicaloidLibrary
private int mBaudrate = 9600;
private int mDataBits = UartConfig.DATA_BITS8;
private int mParity = UartConfig.PARITY_NONE;
private int mStopBits = UartConfig.STOP_BITS1;
StringBuilder mText = new StringBuilder();
int i,len;
byte[] rbuf = new byte[4096];
len = mPhysicaloid.read(rbuf);
if (len>0){
for(i=0; i<len; i++) {
mText.append((char) rbuf[i]);
}
it does not work.
But write data using both library is no problem. Everything works.
Tell me please, why the data can not be read using PhysicaloidLibrary?
The text was updated successfully, but these errors were encountered:
@alekssandr89 When you say update the files? What do you mean exactly?
I'm trying to use only the jar in Android Studio to connect to an Arduino Uno too so any tips would be grand! C
Hi.
I'm trying to use the library with the examples it includes, connecting to an ESP32 and always getting strange characters to read the data received in the application.
Hellow.
On Arduino UNO i read data(use FTD library) like this
StringBuilder mText = new StringBuilder();
FTDriver mSerial = new FTDriver((UsbManager)getSystemService(Context.USB_SERVICE));
PendingIntent permissionIntent = PendingIntent.getBroadcast( this, 0,
new Intent(ACTION_USB_PERMISSION), 0);
mSerial.setPermissionIntent(permissionIntent);
int i,len;
byte[] rbuf = new byte[4096];
len = mSerial.read(rbuf);
if (len>0){
for(i=0; i<len; i++) {
mText.append((char) rbuf[i]);
}
It's work great.
But when i try read data use PhysicaloidLibrary
private int mBaudrate = 9600;
private int mDataBits = UartConfig.DATA_BITS8;
private int mParity = UartConfig.PARITY_NONE;
private int mStopBits = UartConfig.STOP_BITS1;
StringBuilder mText = new StringBuilder();
Physicaloid mPhysicaloid = new Physicaloid(this);
mPhysicaloid.open();
mPhysicaloid.setConfig(new UartConfig(mBaudrate, mDataBits, mStopBits, mParity, false, false));
int i,len;
byte[] rbuf = new byte[4096];
len = mPhysicaloid.read(rbuf);
if (len>0){
for(i=0; i<len; i++) {
mText.append((char) rbuf[i]);
}
it does not work.
But write data using both library is no problem. Everything works.
Tell me please, why the data can not be read using PhysicaloidLibrary?
The text was updated successfully, but these errors were encountered: