Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 2.36 KB

bmp085.md

File metadata and controls

90 lines (58 loc) · 2.36 KB

###BMP085 Decoders

These BMP085 Decoders are used to decode a payload produced from BMP085 classes from the jeelib library.

BMP085 decodes the example/demo payload structure:

        struct { int16_t temp; int32_t pres; } payload;

An example of which can be found in this sketch:

[https://github.com/jcw/jeelib/tree/master/examples/Ports/bmp085demo]

BMP085Batt is similar in that it adds a uint8_t (lobat) flag:

        struct { int16_t temp; int32_t pres; uint8_t lobat} payload;

An example of which can be found in this sketch:

[https://github.com/TheDistractor/ino/jeelib/tree/master/examples/Ports/bmp085demobatt]

This lobat flag is meant to be a boolean (0|1) to represent a low battery condition. The sketch linked by example uses the internal bandgap method to determine the batterys voltage, and sets the flag only if the voltage drops below the sketch defined level.

To use these decoders, add an entry to the imports section of your Housemon's main.go like this:

	_ "github.com/TheDistractor/flow-ext/decoders/Bmp085"

or

	_ "github.com/TheDistractor/flow-ext/decoders/Bmp085Batt"

You must then edit your circuit definitions file, normally setup.coffee.

You need to incorporate the decoder into the circuit containing your 'nodeMap' gadget.

circuits.nodes =
  gadgets: [
    { name: "nm", type: "NodeMap" }
  ]
  feeds: [
    { data: "RFg212i14,Bmp085,BMP085 WeatherStation",   to: "nm.Info" }

(or use Bmp085Batt in place of Bmp085)

Finally, you need to add the Bmp085 attributes to the appropriate DriverFill circuit:

(Shown here are both, but you only need to add the ones you use, although it wont harm adding both in).

circuits.driverFill =
  gadgets: [
    { name: "db", type: "LevelDB" }
  ]
  feeds: [

    { data: "./data", to: "db.Name" }


    { to: "db.In", tag: "/driver/Bmp085/temp", \
        data: { name: "Temperature", unit: "°C", scale: 1 } }
    { to: "db.In", tag: "/driver/Bmp085/pressure",  \
      data: { name: "Pressure", unit: "hPa", scale: 2 } }

    { to: "db.In", tag: "/driver/Bmp085Batt/temp", \
      data: { name: "Temperature", unit: "°C", scale: 1 } }
    { to: "db.In", tag: "/driver/Bmp085Batt/pressure", \
      data: { name: "Pressure", unit: "hPa", scale: 2 } }
    { to: "db.In", tag: "/driver/Bmp085Batt/lobat", \
      data: { name: "Battery Alarm", unit: "(0/1)" } }

  ]