Class for AD7390, a 12 bit SPI driven external DAC from Analog Devices.
Datasheet - http://www.analog.com/static/imported-files/data_sheets/AD7390_7391.pdf
Diff: main.cpp
- Revision:
- 3:37ec9ea72264
- Parent:
- 2:8633e348822f
- Child:
- 4:0c327b37ddc1
--- a/main.cpp Sat Apr 05 21:06:17 2014 +0000 +++ b/main.cpp Sun Apr 06 20:07:38 2014 +0000 @@ -1,23 +1,26 @@ #include "mbed.h" #include "AD7390.h" -AD7390 Test(p5,p7,p10,p11,5,2000000); +SPI spi(p5,p6,p7); +AD7390 Test(spi,p10,p11); DigitalOut Led(LED1); int main(){ -while (1){ -Test.WriteL(2.5); - Led = 1; - wait(5); - Led = 0; - Test.WriteL(4); + Test.Init(); Led = 1; - wait(5); + wait(1); + Test.Latch(); Led = 0; - Test.WriteL(0.5); + wait (1); +while (true){ + + Test.Init(); Led = 1; - wait(5); + wait(1); Led = 0; + wait(1); + + } }