-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dac2ch and pwm2ch libraries & examples, update ActivityBot 360 IR…
… following examples
- Loading branch information
1 parent
b5a0b0c
commit ab8e160
Showing
91 changed files
with
11,229 additions
and
2,027 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Test libdac2ch.c | ||
Test the dac2ch library. | ||
*/ | ||
|
||
#include "simpletools.h" | ||
#include "dac2ch.h" | ||
|
||
dac2ch *dacA; | ||
dac2ch *dacB; | ||
|
||
int main() | ||
{ | ||
// Start two DAC processes, one 8-bit and one 10 bit | ||
dacA = dac2ch_start(8); | ||
dacB = dac2ch_start(10); | ||
|
||
// Set P26 and P27 to 1.65 V, and P5 and P6 to 0.825 V. | ||
dac2ch_set(dacA, 26, 0, 128); | ||
dac2ch_set(dacB, 27, 0, 512); | ||
dac2ch_set(dacA, 5, 1, 64); | ||
dac2ch_set(dacB, 6, 1, 256); | ||
pause(3000); | ||
|
||
// Stop signals on P26 and P5 -> inputs | ||
dac2ch_set(dacA, 26, 0, -1); | ||
dac2ch_set(dacA, 5, 1, -1); | ||
pause(3000); | ||
|
||
// Switch outputs that were on P27 and P6 to P26 and P5. | ||
dac2ch_set(dacB, 26, 0, 768); | ||
dac2ch_set(dacB, 5, 1, 192); | ||
pause(3000); | ||
|
||
// End the dac2ch processes | ||
dac2ch_stop(dacA); | ||
dac2ch_stop(dacB); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Test libdac2ch.c | ||
>compiler=C | ||
>memtype=cmm main ram compact | ||
>optimize=-Os | ||
>-m32bit-doubles | ||
>-fno-exceptions | ||
>defs::-std=c99 | ||
>-lm | ||
>BOARD::ACTIVITYBOARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.