I want to transmit sensor output via Tx/Rx pin. Here is the code:
void setup() {
Serial.begin(115200);
}
void loop()
{
Serial.println(analogRead(A1));
}
So, it is supposed to transmit the data as soon as the device is powered on, but it doesn't.
When I upload the code, Tx LED goes ON (even when the serial monitor is not opened), which shows that it is transmitting. If I press RESET, then also LED is ON.
If plug it out and then plug it in again, the LED is supposed to turn ON (or start transmitting) automatically. But it doesn't. It only turns ON when I start the serial monitor.
I tried with Mega too, and got same result.
In short, my arduino is not transmitting data via UART, automatically. What could be the problem?