Shop OBEX P1 Docs P2 Docs Learn Events
Bmp085 object — Parallax Forums

Bmp085 object

ASAS Posts: 149
edited 2011-04-06 06:48 in Propeller 1
Hi!

I´m not sure how it should be used.
I wrote the code BAROMETRO.SPIN.
All the files I use are in attachement!
CON
  _clkmode = xtal1 + pll16x                  ' System clock → 80 MHz
  _xinfreq = 5_000_000
  CR = 13 

VAR
  word t,p   
 
OBJ
  Baro       :  "bmp085Object"
  Debug      :  "FullDuplexSerialPlus"

PUB Init
  Debug.Start(31, 30, 0, 115200)
  waitcnt(clkfreq * 2 + cnt)
  Baro.init(0,1)
  main

PUB Main 
  repeat
         Debug.Str(String(CR, "start calculations.....")) 
         baro.GetPressureTemp(0,1,3,t,p)
         Debug.Str(String(CR, "T = "))
         Debug.Dec(t)
         Debug.Str(String(CR, "P = "))
         Debug.Dec(P)
         waitcnt(clkfreq*1000 + cnt)

Thanks a lot

Comments

  • th3jesterth3jester Posts: 81
    edited 2011-03-29 10:10
    I've had trouble with the BMP085 as well. Although I ultimately concluded the sensor was bad. What problems are you having?
  • ASAS Posts: 149
    edited 2011-03-29 10:40
    Hello!
    I think the problem is not in the sensor but how i "call" bmp085 object!!! (I think)

    I can get the constants (READ REGISTERS) AC1..AC6; B1, B2; MB, MC, MD. I´m not sure about the signal (positive and negative). And i´m not sure about UT and UP values because i used the program from SMD500.

    When i discovery the object (BMP085) i thought that i have my problem solved but i think I don´t know how use the object.

    The files that i send now are just to READ REGISTERS from the sensor and it works.

    Thanks
  • ASAS Posts: 149
    edited 2011-04-06 06:48
    Hello Tim Moore!
    I need to say thanks because bmp085Object help me a lot :).
    You go think that i´m a big dummy in spin programing :) (it´s true)

    at this moment i just ask why this code to call bmp085Object don´t work:
    CON
      _clkmode = xtal1 + pll16x                  ' System clock → 80 MHz
      _xinfreq = 5_000_000
      CR = 13 
    VAR
      long t,p
      
    OBJ
      Baro       :  "bmp085Object"
      Debug      :  "FullDuplexSerialPlus"
    
    PUB Init
      Debug.Start(31, 30, 0, 115200)
      waitcnt(clkfreq * 2 + cnt)
      Baro.init(0,%1110_1110)
      main
    PUB Main 
      repeat
        Debug.Str(String(CR, "start calculations.....")) 
        baro.GetPressureTemp(0,%1110_1110,1,t,p)
    
        ' Display Result
         Debug.Str(String(CR, "T = "))
         Debug.Dec(t)
         Debug.Str(String(CR, "P = "))
         Debug.Dec(P)
    
         
         waitcnt(clkfreq + cnt)
    

    I get always t=p=0 :(
    I use the logic of bmp085Object to build a program without object and it works very good :)
    I need to learn a lot!
    Thanks a lot for share.
    AS
Sign In or Register to comment.