aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-02-27 06:38:53 -0500
committerPerry Hung <iperry@gmail.com>2011-02-27 06:38:53 -0500
commitc54f98951ea2827598babd4602e0f808b3ee311c (patch)
tree0f5fdda925717330134dd1859e392a2dc0303957 /examples
parent9136ea9015c68fba7302dbe33a759aea43860b2f (diff)
downloadlibrambutan-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.cpp6
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) {