asdf

Dependencies:   KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180

Fork of TestBenchSerenity-proto_F429ZI by Ian Wolf

Committer:
iwolf32
Date:
Thu Jul 27 14:27:22 2017 +0000
Revision:
5:e3eff8a04b25
Parent:
4:79b23d1fbcd1
Child:
6:330773526c35
rev1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dmwahl 0:67debf2ccbc2 1 #ifndef MAIN_H
dmwahl 0:67debf2ccbc2 2 #define MAIN_H
dmwahl 0:67debf2ccbc2 3
dmwahl 0:67debf2ccbc2 4 #include "mbed.h"
dmwahl 0:67debf2ccbc2 5 #include "sensirion_sf04.h"
dmwahl 0:67debf2ccbc2 6
dmwahl 0:67debf2ccbc2 7 // Gas flow sensor defines
iwolf32 5:e3eff8a04b25 8 #define MAINFLOW_ADDR 0x40
dmwahl 0:67debf2ccbc2 9 // End gas flow sensor defines
dmwahl 0:67debf2ccbc2 10
iwolf32 5:e3eff8a04b25 11 Serial pc(USBTX, USBRX, 100000); // tx, rx, baud
dmwahl 0:67debf2ccbc2 12
dmwahl 0:67debf2ccbc2 13 // an I2C sub-class that provides a constructed default
dmwahl 0:67debf2ccbc2 14 class I2CPreInit : public I2C
dmwahl 0:67debf2ccbc2 15 {
dmwahl 0:67debf2ccbc2 16 public:
dmwahl 0:67debf2ccbc2 17 I2CPreInit(PinName sda, PinName scl, int freq) : I2C(sda, scl) {
dmwahl 0:67debf2ccbc2 18 frequency(freq);
dmwahl 0:67debf2ccbc2 19 };
dmwahl 0:67debf2ccbc2 20 };
dmwahl 0:67debf2ccbc2 21
dmwahl 0:67debf2ccbc2 22 //I2CPreInit gI2C1(I2C_SDA, I2C_SCL, I2C frequency);
iwolf32 4:79b23d1fbcd1 23 I2CPreInit i2c3(PB_4, PA_8, 100000);
dmwahl 0:67debf2ccbc2 24
dmwahl 0:67debf2ccbc2 25
dmwahl 0:67debf2ccbc2 26 // Sensirion gas flow sensor object (i2c object, i2c address, calibration field, resolution 9-16 bit)
iwolf32 5:e3eff8a04b25 27 SF04 mainflow(i2c3, MAINFLOW_ADDR, 0, 16); // Gas flow sensor (SFM7033)
dmwahl 0:67debf2ccbc2 28
dmwahl 0:67debf2ccbc2 29 #endif