B4J Question Read Serial port Byte

marco.canta

Active Member
Licensed User
Longtime User
Hi,
I read the serial Arduino with this procedure.
You can read it even with b4j?
I want to read data from the serial port in specific points of the program, and not using the procedure given "Astream_NewData".
it is possible?
Thank you
Marco


B4X:
    String ValRX;
    String ValEvento;
   
    if (Serial.available() > 0) {
      String ValRX = Serial.read();
      if (ValRX == 0xAE) {                  
        for (int i=1; i <= 6; i++){
          char ValRXn = Serial.read();
          ValEvento += (String)ValRXn;
        }
      }
    }
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…