Hello,
I am a new arduino user and i have one problem.
I have two Arduino UNO boards. One board receives the signal (speed) from the GPS NEO-6M and sends it through the RF module to the other Arduino UNO board, which displays it on the display.
The speed is sent from one board to another every second (it can also be seen in the Serial monitor of the receiving board). But if I implement the function to display the speed on the display in the code, only one value is displayed both on the display and in the serial monitor without the possibility of updating.
Can you advise me how to get the speed value to be updated every second even when the display function is implemented.
...and make a better description of what happens, instead of "only one value is displayed both on the display and in the serial monitor without the possibility of updating".
We can't say anything unless you post the entire code, as @UKHeliBob already asked you, and like the forum guidelines require. This is an extract from "How to get the best out of this forum":
Posting a snippet of code is generally useless. The problem is usually in another part of the program.
...
It is very important to be clear about what is expected from code and what happens instead. Code ALWAYS works; that is the nature of code. Whether it does what you expect is a different thing altogether. We need to know what you expected the code to do and what happened instead.
(I suppose with "delete" you mean "comment out the function call")
The code seems to do nothing special with that function, so it could be something to do with the display and/or its library. Have you double checked your library if it's the right and the latest one (e.g. running any other simple sketch to display things at 1 sec interval or less)?
In the meanwhile, as I hate "String" variables, please note you have "atof" function to convert a char array into a float without using "String". Try this:
...
if (vw_get_message(buf, &buflen)) {
// Zpracuj přijatou rychlost
float speed = atof(buf);
Serial.print("Přijatá rychlost: ");
Serial.println(speed);
// Zobraz rychlost na OLED displeji
zobrazRychlost(speed);
}
...