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
main.cpp@2:8633e348822f, 2014-04-05 (annotated)
- Committer:
- cassar10
- Date:
- Sat Apr 05 21:06:17 2014 +0000
- Revision:
- 2:8633e348822f
- Parent:
- 0:82cd70f9fc3f
- Child:
- 3:37ec9ea72264
Class written with test program, now does it work?
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cassar10 | 0:82cd70f9fc3f | 1 | #include "mbed.h" |
cassar10 | 2:8633e348822f | 2 | #include "AD7390.h" |
cassar10 | 0:82cd70f9fc3f | 3 | |
cassar10 | 2:8633e348822f | 4 | AD7390 Test(p5,p7,p10,p11,5,2000000); |
cassar10 | 2:8633e348822f | 5 | DigitalOut Led(LED1); |
cassar10 | 0:82cd70f9fc3f | 6 | |
cassar10 | 2:8633e348822f | 7 | int main(){ |
cassar10 | 2:8633e348822f | 8 | while (1){ |
cassar10 | 2:8633e348822f | 9 | Test.WriteL(2.5); |
cassar10 | 2:8633e348822f | 10 | Led = 1; |
cassar10 | 2:8633e348822f | 11 | wait(5); |
cassar10 | 2:8633e348822f | 12 | Led = 0; |
cassar10 | 2:8633e348822f | 13 | Test.WriteL(4); |
cassar10 | 2:8633e348822f | 14 | Led = 1; |
cassar10 | 2:8633e348822f | 15 | wait(5); |
cassar10 | 2:8633e348822f | 16 | Led = 0; |
cassar10 | 2:8633e348822f | 17 | Test.WriteL(0.5); |
cassar10 | 2:8633e348822f | 18 | Led = 1; |
cassar10 | 2:8633e348822f | 19 | wait(5); |
cassar10 | 2:8633e348822f | 20 | Led = 0; |
cassar10 | 2:8633e348822f | 21 | } |
cassar10 | 2:8633e348822f | 22 | } |
cassar10 | 0:82cd70f9fc3f | 23 |