Shop OBEX P1 Docs P2 Docs Learn Events
Altimeter Module MS5607 w/ Arduino Mega 2560 — Parallax Forums

Altimeter Module MS5607 w/ Arduino Mega 2560

jameshayekjameshayek Posts: 3
edited 2014-03-14 12:03 in General Discussion
Hello all,

I am having trouble with programming the Altimeter Module MS5607. I was following the tutorials posted here: http://learn.parallax.com/KickStart/29124

I
read
Important! This program uses an additional code file,IntersemaBaro.h, which is included in the download. To use this program you must include IntersemaBaro.h in the same folder as the program file. Be sure to download the correct version for the Arduino IDE you are using.

And placed the IntersemaBaro file in the same location (folder) as my Arduino Sketch. (C:\Users\JamesHayek\Documents\Arduino\AltimeterCode\Altimeter001) I provided a screencap of the files location.
Screenshot (76).jpg


I then used the sample code as posted from the site:


/*Team 5's Compliment
  Professor Mario Ibrahim
  NJIT ECE 252
*/






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


Intersema::BaroPressure_MS5607B baro(true);


void setup() { 
    Serial.begin(9600);
    baro.init();
}


void loop() {
  int alt = baro.getHeightCentiMeters();
  Serial.print("Centimeters: ");
  Serial.print((float)(alt));
  Serial.print(", Feet: ");
  Serial.println((float)(alt) / 30.48);
  delay(400);
}


I am getting the following error: Altimeter001.ino:11:27: error: IntersemaBaro.h: No such file or directory



As of now I just plan on using the sample file to test the module and its functionality. Eventually I will use this data to drive a RGB LED to produce red or blue light to predict if it will be rainy or dry outside.

Please let me know any suggestions as to what I was doing wrong.

Thanks in advance


Btw, I used the download link: Download Arduino 1.0 Code for the Altimeter Module
1024 x 576 - 47K

Comments

  • FranklinFranklin Posts: 4,747
    edited 2014-03-13 22:03
    I am getting the following error: Altimeter001.ino:11:27: error: IntersemaBaro.h: No such file or directory
    This means the file is not where the Arduino IDE looks for include files. This may need to be put in your libraries folder but I would check with the folks at arduino.cc
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-03-14 10:27
    The include file is fine with the sketch. The sketch is written to look for the Intersema.h file in the same folder.

    If you open the sketch and the Intersema file is not also shown in its own window tab in the Arduino IDE, you know that somehow the IDE is not finding the file. To ensure against mistakes, go back to the original download, don't rename files or folders, and place inside your Arduino sketch folder (not another folder within that).

    All said, the code for a Uno will NOT work on a Mega. The pins for I2C are different between these two boards. Refer to the specifications on the Arduino Web site for how you need to rewire your board in order to use the correct pins.
  • jameshayekjameshayek Posts: 3
    edited 2014-03-14 11:18
    I download Arduino IDE 2.5.4 (latest to date)

    Thanks, GordonMcComb, I now see another tab in the Arduino IDE with the IntersemaBaro.h file's content. I uploaded the sketch after choosing the board type and it works great!!

    Can I ask however, where can I find libraries/functions/commands/documents to call for a read out value of say something like temperature or humidity?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-03-14 12:03
    jameshayek wrote: »
    I download Arduino IDE 2.5.4 (latest to date)

    Thanks, GordonMcComb, I now see another tab in the Arduino IDE with the IntersemaBaro.h file's content. I uploaded the sketch after choosing the board type and it works great!!

    Can I ask however, where can I find libraries/functions/commands/documents to call for a read out value of say something like temperature or humidity?

    The latest Arduino IDE for Windows is 1.0.5. You must be referring to something else.

    For this board you'd need to refer to the original datasheet for the pressure sensor/altimeter chip used on it, and you can download the code examples for the other microcontrollers. General documentation and an app note for the chip-level sensor is provided on the Parallax page for the module. The app note is quite complicated.

    There are many other resources for this chip, though most of them require advanced programming. For example, the following page contains C code for the MS56XX series of chips and Atmel processors:

    http://www.servoflo.com/pressure-sensors/suppliers/measurement-specialties/227-measurement-specialties-a-intersema/781-an520.html

    Maybe someone has ported this to the Arduino.
Sign In or Register to comment.