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.
Diff: AD7989.h
- Revision:
- 5:558b7506e684
- Parent:
- 4:be5656dbc656
- Child:
- 6:e018ebbbc7eb
--- a/AD7989.h Mon Jan 21 19:06:35 2019 +0000
+++ b/AD7989.h Mon Jan 21 19:08:10 2019 +0000
@@ -5,6 +5,23 @@
/** An abstraction for an 18 bit ADC
* @note Not quite sure this is thread or interrupt safe. Treat this as a standard mbed SPI object
* There are mutex locks when the SPI bus is being used.
+ * @code
+ * #include "mbed.h"
+ * #include "AD7989_Driver.h"
+ *
+ * SPI spi(p5, p6, p7); // mosi, miso, sclk
+ * DigitalOut cs(p8);
+ * Digitalout convert(p9);
+ * AD7989_Driver ADCDEV(&spi, &cs, &convert);
+ * double voltage;
+ * int main()
+ * {
+ * while(1)
+ * {
+ * voltage = ADCDEV.sample();
+ * printf("Voltage = %f Volts", voltage);
+ * }
+ * }
*/
class AD7989_Driver
{