anchor.diff:  PB7 constant SDA
   
   include ../flib/i2c-bb.fs
  -
  -PA5 constant LED1
  -PA1 constant LED2
  -
  -: init-board ( -- )
  -  OMODE-PP LED1 io-mode!
  -  OMODE-PP LED2 io-mode!
  -;
   
   : bme-init ( -- )
     +i2c
  
positive.code: \ Try reading out the BME280 sensor.
  
  \ define some missing constants
  4 constant io-ports  \ A..D
  
negative.code:   ( H5: ) 29 bme-s16 4 arshift
    r@ * - 16384 + 15 arshift
    ( H6: ) 31 bme-u8 24 lshift 24 arshift
    r@ 10 *>>
    ( H3: ) 27 bme-u8
    r> 11 *>> 32768 + 10 *>> 2097152 +
    ( H2: ) 25 bme-s16
    * 8192 + 14 arshift *
    dup 15 arshift 7 ^2>>
    ( H1: ) 24 bme-u8
    4 *>> -  0 max  419430400 min  12 arshift
    100 * 512 + 10 arshift  \ convert 1/1024's to 1/100's, w/ rounding
  ;
  
  : go
    bme-init  bme-calib
    params 32 dump
    begin
      bme-data bme-hpt
  