I have Wifi module hlk-rm04 connected to my arduino UNO.
Wifi module sends data to udp
server when it has data in rx
buffer.
It works when I typing data directly in serial monitor window and clicking send button.
But when I use Serial.print()
or Serial.write
data is not sending.
Is there any difference between Serial.print()
and typing and clicking send button, and how can I program it?
Testing code witch every second should send random value + Hello
unsigned long time0;
void setup() {
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
time0= millis();
}
void loop() {
time0 = millis();
if ((time0 % 1000) == 20)
{
Serial.print(random(0, 10));
Serial.print("Hello");
Serial.print(("_____________________________"));
delay(2);}
}