Finding functions...

Greetings everyone...

I'm currently looking at a code example for MPU-6050 usage, written by Jeff Rowberg.

In this code there are statements that use a function called 'F' with a double quoted string as a parameter.

My first question is, in a case like this where I want to know what 'F(string)' does, how do I locate where the function comes from. I mean is there an IDE based way to easily find the function/method or its declaration? Or am I forced to try to search all the includes until I find it. I've looked at the Arduino IDE reference page and cannot find anything; and I seriously doubt there would be an official function named 'F'...

The only includes in the code example are:

#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include "Wire.h"
#endif

and here are a couple of lines using the function:

  // verify connection
  Serial.println(F("Testing device connections..."));
  Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed"));

What general procedure would one of you experienced folks follow to track down what 'F' is?

I'd read the manual

(F is a macro, not a function)

@OP

This is the link for the above quote.

GolamMostafa:
This is the link for the above quote.

Awesome! Thank you!

Follow on question: Where can I read more to help me understand why I might want to use the flash memory versus SRAM?

If you're using constant literal strings, use flash, otherwise use RAM.

first link in the article about PROGMEM: http://playground.arduino.cc/Learning/Memory

Some things for you to master:

Arduino links of interest.

How to use this forum:
https://forum.arduino.cc/index.php?topic=149014.0

Listing of downloadable 'Arduino PDFs' :
Either Google >>>- - - - > arduino filetype: pdf
Or
https://www.google.ca/search?q=arduino+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=arduino+filetype%3A+pdf&aqs=chrome..69i57j69i65.1385j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8

Listing of downloadable 'C++ PDFs' :
Either Google >>>- - - - > C++ filetype: pdf
Or
https://www.google.ca/search?q=c%2B%2B+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=c%2B%2B+filetype%3A+pdf&aqs=chrome..69i57.22790j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8

Arduino cheat sheet:

Troubleshooting common errors:

Watch these:
Arduino programming syntax:

Arduino arithmetic operators:

Arduino control flow:

Arduino data types:

Some things to read

https://learn.adafruit.com/category/learn-arduino

https://learn.sparkfun.com/tutorials/how-to-read-a-schematic

Language Reference:
https://www.arduino.cc/en/Reference/HomePage

Foundations:

How and Why to avoid delay():
http://playground.arduino.cc/Code/AvoidDelay

Demonstration code for several things at the same time.
http://forum.arduino.cc/index.php?topic=223286.0

Useful links:

Arduino programming traps, tips and style guide:
http://www.gammon.com.au/forum/?id=12153

Jeremy Blume:

Arduino products:
https://www.arduino.cc/en/Main/Products

Motors/MOSFETs
http://www.gammon.com.au/motors

Switches:
http://www.gammon.com.au/forum/?id=11955

Share tips you have come across, 500+ posts:

Images from above:
https://www.google.com/search?q=“Share+tips+you+have”+larryD+site:https://forum.arduino.cc&prmd=nmvi&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiJw-zu68ncAhXPGTQIHWCDCNwQ_AUIFCgE&biw=1024&bih=653

Debug discussion:

.