Dependencies:   KellerDruck_pressure PID PWM-Coil-driver Sensirion_SF04 VL6180

Fork of PUMP_SCRIPT by Ian Wolf

main.h

Committer:
iwolf32
Date:
2017-07-27
Revision:
6:e3eff8a04b25
Parent:
4:79b23d1fbcd1

File content as of revision 6:e3eff8a04b25:

#ifndef MAIN_H
#define MAIN_H

#include "mbed.h"
#include "sensirion_sf04.h"

// Gas flow sensor defines
#define MAINFLOW_ADDR 0x40
// End gas flow sensor defines

Serial pc(USBTX, USBRX, 100000); // tx, rx, baud

// an I2C sub-class that provides a constructed default
class I2CPreInit : public I2C
{
public:
    I2CPreInit(PinName sda, PinName scl, int freq) : I2C(sda, scl) {
        frequency(freq);
    };
};

//I2CPreInit gI2C1(I2C_SDA, I2C_SCL, I2C frequency);
I2CPreInit i2c3(PB_4, PA_8, 100000);


// Sensirion gas flow sensor object (i2c object, i2c address, calibration field, resolution 9-16 bit)
SF04 mainflow(i2c3, MAINFLOW_ADDR, 0, 16); // Gas flow sensor (SFM7033)

#endif