diff options
author | Perry Hung <iperry@gmail.com> | 2011-02-27 06:38:53 -0500 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2011-02-27 06:38:53 -0500 |
commit | c54f98951ea2827598babd4602e0f808b3ee311c (patch) | |
tree | 0f5fdda925717330134dd1859e392a2dc0303957 /examples | |
parent | 9136ea9015c68fba7302dbe33a759aea43860b2f (diff) | |
download | librambutan-c54f98951ea2827598babd4602e0f808b3ee311c.tar.gz librambutan-c54f98951ea2827598babd4602e0f808b3ee311c.zip |
Refactor DAC
DAC header and source slightly cleaned up. Test on Maple Native prototype. Add
flags parameter to allow selective enabling of channels.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/test-dac.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/test-dac.cpp b/examples/test-dac.cpp index 3a699e2..62f40eb 100644 --- a/examples/test-dac.cpp +++ b/examples/test-dac.cpp @@ -16,7 +16,7 @@ void setup() { Serial1.println("**** Beginning DAC test");
Serial1.print("Init... ");
- dac_init();
+ dac_init(DAC_CH1 | DAC_CH2);
Serial1.println("Done.");
}
@@ -29,8 +29,8 @@ void loop() { count = 0;
}
- dac_write(1, 2048);
- dac_write(2, count);
+ dac_write_channel(1, 4095 - count);
+ dac_write_channel(2, count);
}
int main(void) {
|