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

Bmp085 object

ASAS Posts: 149
edited 2011-03-29 12:10 in Accessories
Hi!

I´m not sure how it should be used.
I wrote the code BAROMETRO.SPIN.
(i don´t know how u put it here in boxes, i go "copy paste")
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!

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-28 12:00
    attachment.php?attachmentid=78421&d=1297987572
  • ASAS Posts: 149
    edited 2011-03-28 12:07
    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!
  • PublisonPublison Posts: 12,366
    edited 2011-03-29 11:41
    Could you possibly attach with a .zip file? .rar is not a normal file format here.
  • ASAS Posts: 149
    edited 2011-03-29 12:10
    Thanks for the interest!

    AS
Sign In or Register to comment.