APDE USB / OTG communication

@ZENAR57 have you mange how to import libraries with apde 5.1 ? if not back to the past topic there is how to do it

1 Like

5.1 alpha-No
5.2betta-good

read the last topic for 5.1

just tried 5.1 beta … also does not work.but there is an option to install libraries at 5.2.then remove 5.2 and put 5.1 all libraries are saved.

1 Like

nice work but as for me i can not dive deep because i have other electronics interests my aim from processing programming is to make controls with Arduino and microelectronics

i can learn from 2 or 3 example of certain point if i stuck with some issues, if i couldn’t i ask here and there is a lot of good guys willing help

2 Likes

thats cool, didn’t know if it would be helpful or not.

1 Like

it is for sure many others figuring out multi issues and you are posting good and helpful point

1 Like

i modify it to run via OTG


1 Like

great, very interesting.I checked in there right away.thank you very much for the helpful information.

APDE 5.1 latest beta

device_filter.xml- ok

manifest


Ok
.
.
.


1 Like

if you got this then you made it

2 Likes

but I getting wrecked a primitive polling of devices.
.
Serial.list (this) [0]
.
I put the library well, in manual mode, through dfx .
.
-glv- wrote that he also did it on the phone. but he did not indicate which library he was using.I have provided an annotation and a direct link to the library that I used. in my previous post. but I do not understand this library is needed, or another.

Do I need it, or do I not need to install it additionally?

your sketch run good post it i think the crush you have is from the connected hardware explain what you did

1 Like
import org.slf4j.*;
import org.slf4j.helpers.*;
import com.yourinventit.processing.android.serial.*;
import com.hoho.android.usbserial.util.*;
import org.slf4j.spi.*;
import com.hoho.android.usbserial.driver.*;
import org.slf4j.impl.*;



Serial port;
int temp=1;
void setup(){
 if (Serial.list(this)[0] ==null){temp=0;}
//port = new Serial(this,Serial.list(this)[0],57600);
//port.bufferUntil('\n');
  size(800,800);
}

void draw (){
  fill(255, 0, 0);
  ellipse(100, 100, 100,100);
  text(temp, 300,300);
  
}

do you have Arduino or not ?

Yes.
Yes.
Yes.
Uno.
through the terminals that are on the screenshots today, it works fine.

what is the serial driver chip or your Arduino ?

1 Like

this work with me using android mode did not crash

//////////////////////////////////////////////////////////
//
// supersimple application which sends 1 0 1 0 (toggle)
// after each mouse click to the serial
//
//
//  basic infos
//  ===========
//  https://github.com/mik3y/usb-serial-for-android
//    Lib for android > 3.1 to use the USB interface in host mode (OTG)
//  https://github.com/inventit/processing-android-serial
//    Processing wrapper for the usb-serial-for-android lib
//
import com.yourinventit.processing.android.serial.*;

Serial SerialPort;
boolean Toggle;

void setup()    
{
  println(Serial.list(this));
  
  // this simple initialisation works only when one Serial consumer (e.g. an Arduino)
  // is connected. Serial.list provides a list with all Usb Serial devices attached
  // to this machine.
  SerialPort = new Serial(this, Serial.list(this)[0], 9600);
}

void draw()
{

}

void mousePressed() {
  Toggle = !Toggle;
  SerialPort.write( Toggle?"1":"0");
}