Hi,
I am using Arduino atMega 2560 for my Project.
I am writting program in Arduino IDE under LINUX.
I am successful in controlling Arduino through USB programming.
I came across an issue that is I do not see output on GPIOs if I do not turn on the Serial Monitor.
But if I open the Serial Monitor Screen I am able to see the outputs on GPIOs.
Finally in the Application I do not have freedom to turn on the IDE always.
Please let me know how to overcome this as I need to see the output even if Serial Monitor is off.
system
May 24, 2019, 12:04pm
2
Please let me know how to overcome this as I need to see the output even if Serial Monitor is off.
Where do you expect the serial output to show up, if the Serial Monitor is not the place?
What does your code look like?
Hi,
Thanks for the reply.
I am not expecting any data from Arduino to Serial Monitor.
My code is only to control embedded devices from Arduino GPIOs.
Show your code, or we can't help.
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available() > 23)
{
BITE = Serial.read();
if(BITE == 1);
{
Serial.println("Arduino Connected Succesfully");
}
M1_MSB = Serial.read();
M1_LSB = Serial.read();
M2_FSEL= Serial.read();
M3_MSB = Serial.read();
M3_LSB = Serial.read();
LO1_Reg3_Byte1 = Serial.read();
LO1_Reg3_Byte2 = Serial.read();
LO1_Reg3_Byte3 = Serial.read();
LO1_Reg4_Byte1 = Serial.read();
LO1_Reg4_Byte2 = Serial.read();
LO1_Reg4_Byte3 = Serial.read();
LO1_Reg5_Byte1 = Serial.read();
LO1_Reg5_Byte2 = Serial.read();
LO1_Reg5_Byte3 = Serial.read();
LO2_Reg3_Byte1 = Serial.read();
LO2_Reg3_Byte2 = Serial.read();
LO2_Reg3_Byte3 = Serial.read();
LO2_Reg4_Byte1 = Serial.read();
LO2_Reg4_Byte2 = Serial.read();
LO2_Reg4_Byte3 = Serial.read();
LO2_Reg5_Byte1 = Serial.read();
LO2_Reg5_Byte2 = Serial.read();
LO2_Reg5_Byte3 = Serial.read();
} // loop end
After this I have a function to digitalWrite data
Varunish19021992:
I am not expecting any data from Arduino to Serial Monitor.
But surely you are expecting data from the serial monitor ...
There is only one print statement "Arduino Connected Succesfully".
I have commented / removed from the code and tried but issue remains same.
What about these statements then?
M1_MSB = Serial.read();
You are reading a bunch of numbers into your variables from the serial interface . You haven't showed us the code to manipulate the gpio pins, but I suspect it depends on the variables you read through the serial monitor.
Oh wait, do you have the function for your gpio's outside the loop function and never call it?
I am sending data from HOST PC to Arduino through USB.
My understanding is Serial.read() is reading data from USB and controlling the GPIOs on board
Can you show the full code you use? Post it in code tags (the </> button in the top left corner).
system
May 24, 2019, 1:20pm
11
if(BITE == 1);
It's a rare if statement that properly ends in a semicolon.