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.
You are viewing an older revision! See the latest version
Homepage
#include "mbed.h" #include "AD7490.h" DigitalOut myled(LED1); int main() { // set up SPI interface. // should be set before call AD7490 constructer SPI spi(p11,p12,p13); spi.format(16,0); spi.frequency(1000000); // construct AD7490 instances AD7490 ad1(spi, p9); AD7490 ad2(spi, p10); // start ad conversion with sequential mode ad1.sequential(); ad2.sequential(); short ad_data[32]; while(1) { myled = 1; ad1.read(&ad_data[ 0]); ad2.read(&ad_data[16]); myled = 0; for(int i=0; i<32; i++) printf("ch[%2d]: %d\n", i, ad_data[i]); puts(""); wait(1); } }