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.
For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all
main.cpp@0:7e16d7d35a02, 2016-05-04 (annotated)
- Committer:
- adisuciu
- Date:
- Wed May 04 08:25:44 2016 +0000
- Revision:
- 0:7e16d7d35a02
Initial revision
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| adisuciu | 0:7e16d7d35a02 | 1 | #include "mbed.h" |
| adisuciu | 0:7e16d7d35a02 | 2 | #include "AD7790.h" |
| adisuciu | 0:7e16d7d35a02 | 3 | //------------------------------------ |
| adisuciu | 0:7e16d7d35a02 | 4 | // Hyperterminal configuration |
| adisuciu | 0:7e16d7d35a02 | 5 | // 9600 bauds, 8-bit data, no parity |
| adisuciu | 0:7e16d7d35a02 | 6 | //------------------------------------ |
| adisuciu | 0:7e16d7d35a02 | 7 | |
| adisuciu | 0:7e16d7d35a02 | 8 | Serial pc(SERIAL_TX, SERIAL_RX); |
| adisuciu | 0:7e16d7d35a02 | 9 | AD7790 ad7790(1.2,D8); // reference voltage 1.2 V - only used in voltage computations |
| adisuciu | 0:7e16d7d35a02 | 10 | |
| adisuciu | 0:7e16d7d35a02 | 11 | |
| adisuciu | 0:7e16d7d35a02 | 12 | int main() { |
| adisuciu | 0:7e16d7d35a02 | 13 | pc.printf("Hello AD7790 !\r\n"); |
| adisuciu | 0:7e16d7d35a02 | 14 | ad7790.reset(); |
| adisuciu | 0:7e16d7d35a02 | 15 | while(1) { |
| adisuciu | 0:7e16d7d35a02 | 16 | wait(1); |
| adisuciu | 0:7e16d7d35a02 | 17 | pc.printf("Data register read from the ADC is %x \r\n", ad7790.read_u16()); |
| adisuciu | 0:7e16d7d35a02 | 18 | } |
| adisuciu | 0:7e16d7d35a02 | 19 | } |
| adisuciu | 0:7e16d7d35a02 | 20 |
Analog Devices AD7790