Serial block component

the last row in the 'connect' block is just to call the 'open serial'
'status' is a label (text field) on the frontpanel that gets the return message from the 'open serial' which can be true or false

there is a fantastic solution contributed by rkl099

he implemented an extension over the last months you can find on github:

and follow the discussion here

it works with arduino nano clones (CH340) as well as FTDI Serial adapters

here a basic test program for input/output by clicking buttons:

Hi. Have you figured it out how to set different baudrate than 9600?
For me it works only at 9600
Michał

Hi!
There's a long time I don't visit this thread.
I didn' t try these settings but...
Michal, have you tried changing Serial1.baudRate variable?
There is a set of allowed values which depend on hardware and software. Usual values are: 9600, 14400, 28800, 57600, 115200, ...
Hope this helps.
Fábio.

Are you using SerialOTG?
What device are you trying to connect to?

Hi @Diego I really hope that you can help me.
I am using appinventor to command an arduino uno wifi rev 2 that has to drive an attached servo motor. My commands in the app are a calibration and a turning on and of some modalities of driving. All is work properly!
What I need is to see inside a window of the app what I can see in the serial monitor of arduino. Indeed, the code has many Serial.println. How can I do?

Thanks

Hi Django.
Where your sketch uses the Serial.println statement, send the same data to the port that is in communication with the Android device. In the app, read the received data and display it in a label.

What is the comms channel between the Android device and the Uno? Is it wifi?

Nope @NissanCedric. Thank you firstly! By the way, I show you my superficial code and a draw of the system. All is setted to 57600 baud rate. I can't avoid it because this is the standard for dynamixel.
By the app , I can only send A and B. I can read the output only if I open the serial monitor at pc and if I connect the arduino via USB to the pc. It work perfectly .
I want the same stuff but with the Bluetooth at [7,8] pins

#include <SoftwareSerial.h>  //comunicazione Bluetooth

SoftwareSerial BTSerial(7,8);

#include <Arduino_LSM6DS3.h> //accelerometro
#include <DynamixelShield.h> //attacco DXL

//SETUP DXL
const uint8_t DXL_ID = 1;
const float DXL_PROTOCOL_VERSION = 2.0;
DynamixelShield dxl;
//This namespace is required to use Control table item names
using namespace ControlTableItem;
#define DEBUG_SERIAL Serial

int Object_position_A;
int Object_position_B;
int walk_state;
int read_acc;
int state_Athr=0;
int state_Bthr=0;

float x,y,z,Athr,Bthr;

void setup() {
DEBUG_SERIAL.begin(57600);
delay(1000);
BTSerial.begin(57600);
delay(1000);
IMU.begin();
delay(1000);
dxl.begin(57600);

// Set Port Protocol Version. This has to match with DYNAMIXEL protocol version.
dxl.setPortProtocolVersion(DXL_PROTOCOL_VERSION);

// Turn off torque when configuring items in EEPROM area
dxl.torqueOff(DXL_ID);
dxl.setOperatingMode(DXL_ID, OP_POSITION);

// dxl.torqueOn(DXL_ID);
DEBUG_SERIAL.println("Connect the device via bluetooth") ;

}

String line;
void loop() {
if (BTSerial.available()){
line = BTSerial.readStringUntil('\n');
}

// WALK MODE
if(walk_state==0 && line == "1"){
dxl.torqueOn(DXL_ID);
DEBUG_SERIAL.println("FUNZIONE ABILITATA");
walk_state=1;
read_acc=1;
DEBUG_SERIAL.println(Athr);
DEBUG_SERIAL.println(Bthr);
}
if(read_acc==1){
IMU.readAcceleration(x, y, z);

                      DEBUG_SERIAL.print("X:");
                      DEBUG_SERIAL.print(x);
                      DEBUG_SERIAL.print(",");
                      DEBUG_SERIAL.print("Y:");
                      DEBUG_SERIAL.print(y);
                      DEBUG_SERIAL.print(",");
                      DEBUG_SERIAL.print("Z:");
                      DEBUG_SERIAL.print(z);
                      DEBUG_SERIAL.print(",");
                      
                      DEBUG_SERIAL.print("\t");
                              if (y<A_thr ){         
                                                dxl.setGoalPosition(DXL_ID, Object_position_A,UNIT_DEGREE);
                                                delay(100);
                                                DEBUG_SERIAL.println("A setted");
                              }
                              else if(y>B_thr ){                        
                                                   dxl.setGoalPosition(DXL_ID, Object_position_B,UNIT_DEGREE);
                                                  delay(100);
                                                  stance=0;
                                                  swing=1;
                                                   DEBUG_SERIAL.println("B setted");
                              }
                              else {
                                              
                           }
                 }

if(walk_state==1 ){
dxl.torqueOff(DXL_ID);
DEBUG_SERIAL.println("FUNZIONE DISABILITATA");
walk_state=0;
read_acc=0;

}
}