#Include <x.h> for MPL3115A2 pressure sensor?

Hi. I am very new to arduino and I have to jump into the thick of it for a project requiring the mpl3115a2 barometric sensor. I have followed the direct instructions on the tutorial in this link:

https://learn.sparkfun.com/tutorials/mpl3115a2-pressure-sensor-hookup-guide/all.pdf.

Everything is hooked up correctly, but when I go to the provided library and run the basic SparkfunMPL3115A2 file, I get this very odd result on the serial monitor.

“ôVV´£Ò–SC0ËIR©BYô´#B—´#“ð]!Á÷´#B“RFGARVFC—´#B“Q”

So I tried different codes from the internet, such as this basic one that should print pressure and altitude directly.

https://codebender.cc/example/MPL3115A2/Pressure#Pressure.ino

 */

#include <Wire.h>
#include "MPL3115A2.h"

//Create an instance of the object
MPL3115A2 myPressure;

void setup()
{
  Wire.begin();        // Join i2c bus
  Serial.begin(9600);  // Start serial for output

  myPressure.begin(); // Get sensor online

  // Configure the sensor
  //myPressure.setModeAltimeter(); // Measure altitude above sea level in meters
  myPressure.setModeBarometer(); // Measure pressure in Pascals from 20 to 110 kPa
  
  myPressure.setOversampleRate(7); // Set Oversample to the recommended 128
  myPressure.enableEventFlags(); // Enable all three pressure and temp event flags 
}

void loop()
{
  /*float altitude = myPressure.readAltitude();
  Serial.print("Altitude(m):");
  Serial.print(altitude, 2);

  altitude = myPressure.readAltitudeFt();
  Serial.print(" Altitude(ft):");
  Serial.print(altitude, 2);*/

  float pressure = myPressure.readPressure();
  Serial.print("Pressure(Pa):");
  Serial.print(pressure, 2);

  //float temperature = myPressure.readTemp();
  //Serial.print(" Temp(c):");
  //Serial.print(temperature, 2);

  float temperature = myPressure.readTempF();
  Serial.print(" Temp(f):");
  Serial.print(temperature, 2);

  Serial.println();
}

And now, like many others I have tried it says that “MPL3115A2 does not have a name type.” I have no idea what this means because as I said, I have no idea how to use arduino programming aside from some similarities between RobotC. I’m sure there is a simple and easy way to fix this, but I don’t know what it is. Could I have some help?

Thanks.

When you get garbage on the Serial monitor like that, the first thing to check is that the baud rate in the code matches the baud rate on the serial monitor.