marco.canta Active Member Licensed User Longtime User Dec 18, 2015 #1 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 Code: Copy 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; } } }
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 Code: Copy 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; } } }
KMatle Expert Licensed User Longtime User Dec 19, 2015 #2 Why not use the event? It is fired but you can do whatever you like (store the data and use it later = "in specific points of the program"). Upvote 0
Why not use the event? It is fired but you can do whatever you like (store the data and use it later = "in specific points of the program").