Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TestBenchSerenity-proto_F429ZI TestBenchFlow HSPFLOW1 TestBenchFlow1 ... more
Diff: keller_pressure.cpp
- Revision:
- 2:d6c82c96dae7
- Parent:
- 1:805ee7853062
--- a/keller_pressure.cpp Wed May 10 16:57:58 2017 +0000 +++ b/keller_pressure.cpp Wed May 10 17:13:47 2017 +0000 @@ -1,3 +1,47 @@ +// Sample code +//#include <mbed.h> +//#include "keller_pressure.h" +// +//DigitalOut myled(LED1); +//Serial pc(SERIAL_TX, SERIAL_RX); +// +//// 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 i2c(PB_9, PB_8, 400000); +//KELLER_PRESSURE pumpP(i2c, 0x40); +// +//int main() +//{ +// pc.baud(250000); +// pc.printf("Starting up...\n\r"); +// if (pumpP.isAvailable()) { +// pc.printf("ACK\r\n"); +// pumpP.readPT(); +// pc.printf("Pmin: %.03f Pmax: %.03f\r\n", pumpP.pmin, pumpP.pmax); +// pc.printf("Year: %d Month: %d Day: %d Mode: %d\r\n", pumpP.year, pumpP.month, pumpP.day, pumpP.mode); +// pc.printf("Status: 0x%x\r\n", pumpP.getStatus()); +// pc.printf("%.02fkPa %.02fpsi %.02fC\r\n", pumpP.pressureKPA, pumpP.pressurePSI, pumpP.temperatureC); +// } +// while (1) { +// // Main loop +// if (pumpP.isAvailable()) { +// pumpP.readPT(); +// pc.printf("%.02fkPa %.02fpsi %.02fC\r\n", pumpP.pressureKPA, pumpP.pressurePSI, pumpP.temperatureC); +// } +// wait(1); +// } +// +//} +// +// End sample code + #include "keller_pressure.h" // Default constructor, input is the I2C address followed by min/max pressures (psi)