Can someone please look over my simulation and give me suggestions on what I can do with RGB lights?

The project is making my traxxas slash (rwd) a FPV car but using mostly Arduino. On the controller side will be a SD card reader, Gyro scope, 2 female 3pin headers (for pots), XBEE, RGB strip and, OLED 0.96inch display (128x64). On the car side will be 2 servos (X,Y), XBEE and a GPS. I dont know what I am doing but I used someone else OLED selection code and made my own:

original:

mine:

EDIT: I no longer have any error codes in my project anymore but I am open to suggestions! I need suggestions on the RGB under glow because I dont know how I can adjust it. Mabey using the pots? also should I add another option for back up sensor or would that be too much? it looks pretty cool to me:

Thanks for reading my gibberish!

I forgot to mention that I cant test this irl because I dont have a OLED display just yet. I will be receiving my order on Monday but Id rather do this in a simulation and have a real professional look over it and save me some headaches.

Hello rclare15

Use a logic analyzer to see what happens.

Insert Serial.println()´s at points of interrest and analyze the test results.

Have a nice day and enjoy coding in C++.

1 Like

I cant test it because in the simulation it says I need Wokwi club for my library. I will keep trying proteus and I will 100% use your suggestion.

Thanks!

You can add a library without being in The Club.

  • to the right of Library Manager is a down-arrow, click it.
  • Click New File and add the name
  • Paste your library file into the new file
  • Change your #include GT/LT symbols (< >) to double-quotes (" ") to indicate local file.
1 Like

Wow thanks man! I got the library up and running but now I am getting tons of error codes that I dont understand. Could you please help me a little and reword this into something that I might understand? thanks again!

Error codes:

oled_menu__upir.ino: In function 'void loop()':
oled_menu__upir.ino:565:38: error: no matching function for call to 'drawStr(int, int, int&)'
         u8g.drawStr(20, 30, POT_X_PIN);
                                      ^
In file included from oled_menu__upir.ino:11:0:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const char*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const char *s) { return u8g_DrawStr(&u8g, x, y, s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note:   conversion of argument 3 would be ill-formed:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const __FlashStringHelper*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const __FlashStringHelper *s) { return u8g_DrawStrP(&u8g, x, y, (u8g_pgm_uint8_t *)s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note:   conversion of argument 3 would be ill-formed:
oled_menu__upir.ino:567:38: error: no matching function for call to 'drawStr(int, int, int&)'
         u8g.drawStr(20, 45, POT_Y_PIN);
                                      ^
In file included from oled_menu__upir.ino:11:0:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const char*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const char *s) { return u8g_DrawStr(&u8g, x, y, s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note:   conversion of argument 3 would be ill-formed:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const __FlashStringHelper*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const __FlashStringHelper *s) { return u8g_DrawStrP(&u8g, x, y, (u8g_pgm_uint8_t *)s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note:   conversion of argument 3 would be ill-formed:
oled_menu__upir.ino:572:31: error: no matching function for call to 'drawStr(int, int, int16_t&)'
         u8g.drawStr(20, 30, gx);
                               ^
In file included from oled_menu__upir.ino:11:0:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const char*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const char *s) { return u8g_DrawStr(&u8g, x, y, s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note:   conversion of argument 3 would be ill-formed:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const __FlashStringHelper*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const __FlashStringHelper *s) { return u8g_DrawStrP(&u8g, x, y, (u8g_pgm_uint8_t *)s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note:   conversion of argument 3 would be ill-formed:
oled_menu__upir.ino:574:31: error: no matching function for call to 'drawStr(int, int, int16_t&)'
         u8g.drawStr(20, 45, gy);
                               ^
In file included from oled_menu__upir.ino:11:0:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const char*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const char *s) { return u8g_DrawStr(&u8g, x, y, s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:171:16: note:   conversion of argument 3 would be ill-formed:
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note: candidate: u8g_uint_t U8GLIB::drawStr(u8g_uint_t, u8g_uint_t, const __FlashStringHelper*) <near match>
     u8g_uint_t drawStr(u8g_uint_t x, u8g_uint_t y, const __FlashStringHelper *s) { return u8g_DrawStrP(&u8g, x, y, (u8g_pgm_uint8_t *)s); }
                ^~~~~~~
/home/hexi/Arduino/libraries/U8glib/src/U8glib.h:201:16: note:   conversion of argument 3 would be ill-formed:

Error during build: exit status 1

Looks like one file is trying to find another... is u8g.h (?) available? Maybe it needs to be "local" also?
[edit]Maybe wokwi has an updated or outdated library mentioned in the error codes?

1 Like

should I make a new file and include that instead?
edit: looks like to me that that library was always local and active?

I found the error!!! I was using the wrong cmd. I did u8g.drawStr it was supposed to be u8g.print. EDIT: I fixed this error too! turns out I wasnt using the mapped values. Now I got another error on the same lines but this time I dont know what the errors are.

Error lines:

        u8g.drawStr(10, 30, "Gyro X:");
        u8g.print(20, 30, xValue); //<-- ERROR
        u8g.drawStr(10, 45, "Gyro Y:");
        u8g.print(20, 45, xValue);//<-- ERROR

Error codes:

oled_menu__upir.ino: In function 'void loop()':
oled_menu__upir.ino:576:33: error: no matching function for call to 'U8GLIB_SSD1306_128X64::print(int, int, int&)'
         u8g.print(20, 30, xValue);
                                 ^
In file included from /arduino/hardware/avr/1.8.6/cores/arduino/Stream.h:26:0,
                 from /arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial.h:29,
                 from /arduino/hardware/avr/1.8.6/cores/arduino/Arduino.h:233,
                 from oled_menu__upir.ino.cpp:1:
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:65:12: note: candidate: size_t Print::print(const __FlashStringHelper*)
     size_t print(const __FlashStringHelper *);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:65:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:66:12: note: candidate: size_t Print::print(const String&)
     size_t print(const String &);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:66:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:67:12: note: candidate: size_t Print::print(const char*)
     size_t print(const char[]);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:67:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:68:12: note: candidate: size_t Print::print(char)
     size_t print(char);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:68:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:69:12: note: candidate: size_t Print::print(unsigned char, int)
     size_t print(unsigned char, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:69:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:70:12: note: candidate: size_t Print::print(int, int)
     size_t print(int, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:70:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:71:12: note: candidate: size_t Print::print(unsigned int, int)
     size_t print(unsigned int, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:71:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int)
     size_t print(long, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:72:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int)
     size_t print(unsigned long, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:73:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:74:12: note: candidate: size_t Print::print(double, int)
     size_t print(double, int = 2);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:74:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:75:12: note: candidate: size_t Print::print(const Printable&)
     size_t print(const Printable&);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:75:12: note:   candidate expects 1 argument, 3 provided
oled_menu__upir.ino:578:33: error: no matching function for call to 'U8GLIB_SSD1306_128X64::print(int, int, int&)'
         u8g.print(20, 45, yValue);
                                 ^
In file included from /arduino/hardware/avr/1.8.6/cores/arduino/Stream.h:26:0,
                 from /arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial.h:29,
                 from /arduino/hardware/avr/1.8.6/cores/arduino/Arduino.h:233,
                 from oled_menu__upir.ino.cpp:1:
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:65:12: note: candidate: size_t Print::print(const __FlashStringHelper*)
     size_t print(const __FlashStringHelper *);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:65:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:66:12: note: candidate: size_t Print::print(const String&)
     size_t print(const String &);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:66:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:67:12: note: candidate: size_t Print::print(const char*)
     size_t print(const char[]);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:67:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:68:12: note: candidate: size_t Print::print(char)
     size_t print(char);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:68:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:69:12: note: candidate: size_t Print::print(unsigned char, int)
     size_t print(unsigned char, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:69:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:70:12: note: candidate: size_t Print::print(int, int)
     size_t print(int, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:70:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:71:12: note: candidate: size_t Print::print(unsigned int, int)
     size_t print(unsigned int, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:71:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:72:12: note: candidate: size_t Print::print(long int, int)
     size_t print(long, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:72:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:73:12: note: candidate: size_t Print::print(long unsigned int, int)
     size_t print(unsigned long, int = DEC);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:73:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:74:12: note: candidate: size_t Print::print(double, int)
     size_t print(double, int = 2);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:74:12: note:   candidate expects 2 arguments, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:75:12: note: candidate: size_t Print::print(const Printable&)
     size_t print(const Printable&);
            ^~~~~
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:75:12: note:   candidate expects 1 argument, 3 provided

Error during build: exit status 1

The error messages are telling you what the problem is, you need to learn how to read them.

I get that they are a bit overwhelming to begin with, but it is important to learn.

oled_menu__upir.ino:576:33: error: no matching function for call to 'U8GLIB_SSD1306_128X64::print(int, int, int&)'
         u8g.print(20, 30, xValue);

Starting with this piece, is is telling you that on line 576, there is a problem that it cannot find a print (20, 30, xValue) style of function.

It seems that this error is repeated in a few places
In subsequent messages it is offering some alternatives that it think might be suitable based upon the function/method name i.e. print. Here is one example:

/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:65:12: note:   candidate expects 1 argument, 3 provided
/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:66:12: note: candidate: size_t Print::print(const String&)
     size_t print(const String &);

What this is saying is that it did find a print function but it accepts just one parameter (not 3). The bit above it tells you that it has found this in Stream.h which relates to HardwareSerial.h - which after a while you will get to know that this relates to the Serial object and thus isn't what you are looking for.

Note that you were closer with your first try where you got this error:

oled_menu__upir.ino: In function 'void loop()':
oled_menu__upir.ino:565:38: error: no matching function for call to 'drawStr(int, int, int&)'
         u8g.drawStr(20, 30, POT_X_PIN);
                                      ^

The alternative suggested do seem to come from the U8glib.h header file and thus do seem more appropriate for what you are looking for.

You need to look at how POT_X_PIN (and POT_Y_PIN) are defined and try to identify why they are triggering the error - which seems to indicate that drawStr is looking for a reference as its third parameter?

Are these values (POT_X_PIN) preprocessor macro definitions by any chance (i.e. created using #define)?

I just had a look at your code and saw the error line in question, it seems like those values are defined as ints. But still the WokWi simulator is having a problem with it. I am not sure why, as you have written it, the POT_X_PIN (and POT_Y_PIN) should be able to be accepted as a reference.

FWIW, I couldn't see the u8glib in your wokwi project - but it does seem to be there as I observed the same compilation error as you are reporting.

Update: Upon further investigation, it looks like the library can only accept strings as the third parameter.

So I suggest trying something like this:

char buf[10];
itoa(POT_X_PIN, buf, 10);
u8g.drawStr(20, 30, buf);
itoa(POT_Y_PIN, buf, 10);
u8g.drawStr(20, 45, , buf);

Ideally create a function along the lines of

void drawInt(int x, int y, int v) {
  char buf[10];
  itoa(v, buf, 10);
  u8g.drawStr(x, y, buf);
}

and just call that instead. so for example:

    // u8g.drawStr(20, 30, POT_X_PIN);
   drawInt(20, 30, POT_X_PIN);

edit: here is the solution

// Assuming xValue and yValue are integer variables
char xValueStr[10]; // Assuming a buffer size of 10 is enough
char yValueStr[10];
snprintf(xValueStr, sizeof(xValueStr), "%d", xValue);
snprintf(yValueStr, sizeof(yValueStr), "%d", yValue);

// Assuming u8g is the U8GLIB_SSD1306_128X64 object
u8g.drawStr(20, 30, xValueStr);
u8g.drawStr(20, 45, yValueStr);

^^^^^^^^^^^^^^^^^^^^^^^^^
Welp I fixed it by asking chatgpt, I feel like a noob again and I cant believe after 3 years I still dont know how to read error codes. This time I will try by my self so here is the error code:

/tmp/ccAZ4yQa.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_sketch.ino.cpp.o.13158':
<artificial>:(.text.startup+0x162): undefined reference to `MPU6050_Base::MPU6050_Base(unsigned char, void*)'
/tmp/ccAZ4yQa.ltrans0.ltrans.o: In function `setup':
oled_menu__upir.ino:367: undefined reference to `MPU6050_Base::initialize()'
oled_menu__upir.ino:380: undefined reference to `MPU6050_Base::testConnection()'
/tmp/ccAZ4yQa.ltrans0.ltrans.o: In function `loop':
oled_menu__upir.ino:392: undefined reference to `MPU6050_Base::getMotion6(int*, int*, int*, int*, int*, int*)'
oled_menu__upir.ino:404: undefined reference to `MPU6050_Base::getMotion6(int*, int*, int*, int*, int*, int*)'
collect2: error: ld returned 1 exit status

Error during build: exit status 1

From the beginning I already see MPU6050 that means its an error with my gyro scope. The next thing I see is

oled_menu__upir.ino:367: undefined reference to `MPU6050_Base::initialize()'
oled_menu__upir.ino:380: undefined reference to `MPU6050_Base::testConnection()

I am guessing its talking about lines 367 accelgyro.initialize(); and lines 380:

Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");`

the next thing its talking about its:

oled_menu__upir.ino:392: undefined reference to `MPU6050_Base::getMotion6(int*, int*, int*, int*, int*, int*)'
oled_menu__upir.ino:404: undefined reference to `MPU6050_Base::getMotion6(int*, int*, int*, int*, int*, int*)'

Again I can see its on lines 404 and 392 and all of these error codes are for the same reason undefined reference. My guess is that the error is in the library am I right?

I did a little more research and looks like to me that its looking for MPU6050_Base.h but I dont have that and instead I used mpu6050.cpp and it gave me a new set of error codes. Please just tell me what I gotta do to fix this issue:

/tmp/ccwQejek.ltrans0.ltrans.o: In function `getMotion6':
/sketch/MPU6050.cpp:1791: undefined reference to `I2Cdev::readTimeout'
/sketch/MPU6050.cpp:1791: undefined reference to `I2Cdev::readTimeout'
/sketch/MPU6050.cpp:1791: undefined reference to `I2Cdev::readBytes(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int, void*)'
/tmp/ccwQejek.ltrans0.ltrans.o: In function `setClockSource':
/sketch/MPU6050.cpp:2541: undefined reference to `I2Cdev::writeBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, void*)'
/tmp/ccwQejek.ltrans0.ltrans.o: In function `setFullScaleGyroRange':
/sketch/MPU6050.cpp:247: undefined reference to `I2Cdev::writeBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, void*)'
/tmp/ccwQejek.ltrans0.ltrans.o: In function `setFullScaleAccelRange':
/sketch/MPU6050.cpp:381: undefined reference to `I2Cdev::writeBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, void*)'
/tmp/ccwQejek.ltrans0.ltrans.o: In function `setSleepEnabled':
/sketch/MPU6050.cpp:2448: undefined reference to `I2Cdev::writeBit(unsigned char, unsigned char, unsigned char, unsigned char, void*)'
/tmp/ccwQejek.ltrans0.ltrans.o: In function `getDeviceID':
/sketch/MPU6050.cpp:2825: undefined reference to `I2Cdev::readTimeout'
/sketch/MPU6050.cpp:2825: undefined reference to `I2Cdev::readTimeout'
/sketch/MPU6050.cpp:2825: undefined reference to `I2Cdev::readBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int, void*)'
collect2: error: ld returned 1 exit status

Error during build: exit status 1

The /tmp/... files seem to have object file extensions... either this is happening during ?linking? or you are using an unsaved .INO.

For the I2C issues, I would guess that #include <Wire.h> is needed.

I am going to take another try at the gyro, right now I removed all of the gyro code and it solved my error code problems. I will try with the code that wokwi provided, thanks for the help so far!

You were right I needed wire.h and I was using the wrong lib. I will keep on improving this project and I am ready for suggestions!

Gyros, you say? Calling @jremington

You can certainly use this to convert your integer to a string for printing.

But, think about the "%d". This tells sprintf that you want the next parameter to be converted as integer. You can put other things in their - for example, you could use "%f" if your variable was a float or double (although I don't think the Arduino implementation has support for "%f". There are heaps of other format specifiers and modifiers.

snprintf and its variants are very powerful conversion functions. So what? I hopefully hear you ask.

What that means is that snprintf is a very big function and brings with it lots of code as it needs to be able to handle all of the possible format strings and modifiers - this is possibly why it doesn't support "%f" on Arduino (they simply removed it to save space).

On the other hand, itoa only does one thing. Thus, the code is very small - which can be important in smaller memory systems. So if it isn't necessary to require a bunch of different conversions and formatting (via the modifiers), why bring in such a large function as sprintf?

By way of example, I tried both for you. The atoi version only required 1630 bytes of program memory. The snprintf version required almost double that at 3034 bytes. If you were working an a smaller MCU with smaller flash memory capacity, that could become important to consider.

Again, it probably isn't that important of a consideration in this instance, but it is something to be aware of.

Here is the test program I used:

void setup() {
char buf[10];

  Serial.begin(115200);
   while (!Serial) {
    delay(1); 
   }

  int x = 42;
  itoa(x, buf, 10);     // Compiles to 1630 bytes FLASH and 188 bytes SRAM
                        // Compiles to 3034 bytes FLASH and 190 bytes SRAM
  //snprintf(buf, sizeof(buf), "%d", x);

  Serial.println(buf);
}

void loop() {
  //do nothing
}

FWIW, if you do decide to use snprintf you are currently missing an opportunity. Consider this function:

void drawLabelledInt(int x, int y, const char* lbl, int v) {
  char buf[40];
  //itoa(v, buf, 10);
  snprintf(buf, sizeof(buf), "%s %d", lbl, x);
  u8g.drawStr(x, y, buf);
}

Which can be called all in one go as:

   drawLabelledInt(10, 30, "Gyro X: ", POT_X_PIN);

All the best with your project.

I am still learning but I understand most of it so thanks a lot!

Could someone please debug my code? I have no Idea why the Arduino goes super slow when I enter parking sensor screen. Much appreciated!

Edit: I switched to Arduino Mega and updated link
Edit 2: Posted wrong link

Edit:
I have most of it figured out and now I am thinking if anyone has seen this message or not. I cant seem to figure out how to get my bn-880 gps working and I will post a new forum about it. Another thing I should add is that I decided not to post so much in the Values screen, instead I am only going to post what ever gps data the Arduino is receiving, whether the sd card is plugged in and lastly, if its logging or not.