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 | 0138947c8a9ad334172ceffadc51927b0b9a86ac (patch) | |
| tree | 6d7a6082b72ef6b03e9e27eb8eb30fc7aa5bc7ca /examples/test-dac.cpp | |
| parent | e82e80a1a795427b3d0dc5c25d8b977564de24ce (diff) | |
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/test-dac.cpp')
| -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) {
|
