What is your goal - what do you hope to achieve that the "Serial USB Monitor" App does not already deliver?
I am on the programming forum and I would like to make my application and you recommend that I use the program from the play store. xD
It is simple by me on logic, but I'm not a programmer to handle it. I know that when trying to connect, the phone sends some characters to the terminal and I don't want it. That's all I mean.
We need to see your hardware setup and your App Inventor Project file (.aia). Not convinced about the Sketch - post the link to it.
[quote="OMGlinuxIS, post:11, topic:57116"]
you recommend that I use the program from the play store
[/quote] I didn't make a recommendation but I did ask a question.
But that's not a problem, just app sending some data on connection. I know that you can modify the program on arduino, but I prefer the line to be "clean" from the beginning because it can be very useful.
I have 2x Arduino 2xNRF24l01 (one arduino is arduino mega but it does not matter, the connection of the pins is only different) the programs on both arduino are THE SAME. According to your tutorial, I can send data via arduino with nrf and then bluetooth or vice versa using additional TX and RX ports on the arduino MEGA.
It will definitely be the second function, but first I would like to deal with the cable connection. I would like to remove these characters when connecting,
Here's something, but I don't know in the end .. my English is too weak and the translator doesn't always translate well. Re: Data Input demo sketch - #12 by Robin2 - Programming Questions - Arduino Forum
The ATmega16U2 has a bug in firmware. When you open the COM port without resetting the MCU Atmega328P the ATmega16U2 send a pulse to the Atmega328P RX line (and also to the USB lines but it’s ignored, I think) that is interpreted as data depending on baud rate. If you use 9600 is ignored but starting from about 38400 it appears as character.
I doesn’t appear if you use another chip as serial/USB converter, for example clones that use CH340.
Serial.flush
"Waits for the transmission of outgoing serial data to complete. (Prior to Arduino 1.0, this instead removed any buffered incoming serial data.)"
I don't understand what it would do for me. I would like to find out from the person who created the app inventor if he can or can reset the entire arduino or whether it is possible to remove this MCU Atmega328P reset
Right - where is the input for 'username' coming from? Your phone via the App?
username = Serial.readStringUntil('\n');
Was the input of the username five characters? What is the actual username that was typed-in? I think nothing was typed, but the read is executed and doesn't stop until '\n' - so memory is read, unrecognised characters, hence the ��
Edit: In other words, the code is reading User Input before the User has typed-in a name.
Concerning your App Inventor project, the Clock Timer is setup to constantly read from the moment the App is opened. It is also reading every 1 millisecond? You have one serial channel for read and write? That means you need an event for read and an event for send to ensure the two streams do not coincide.
No, it resets to the bootloader that waits for a new sketch. After a timeout it restarts the previous loaded sketch. (the same thing happens if you press the reset button, or starts the Arduino serial monitor)