Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//_ADC_ |
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 @@ | ||
//_ADC_ |
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,22 @@ | ||
//============================================ | ||
// ADC demo | ||
// Using new added internal 2.56V reference | ||
//============================================ | ||
|
||
uint16_t value; | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
analogReference(INTERNAL2V56); | ||
|
||
Serial.begin(19200); | ||
|
||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
value = analogRead(VCCM); | ||
|
||
Serial.println(value); | ||
delay(1); | ||
} |
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 @@ | ||
//_DAC_ |
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 @@ | ||
//_DAC_ |
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,22 @@ | ||
//============================================ | ||
// DAC0 output demo | ||
// DACO output ==> D4 on board | ||
//============================================ | ||
|
||
unsigned char value = 0; | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
analogReference(INTERNAL2V56); | ||
pinMode(4, ANALOG); | ||
|
||
analogWrite(4, 255); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
//analogWrite(4, value); | ||
delay(10); | ||
value += 10; | ||
} | ||
|
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 @@ | ||
//_sysclock_ |
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 @@ | ||
//_sysclock_ |
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,18 @@ | ||
// demo for system clock switch | ||
// using function "sysClock(mode)" to switch | ||
// system clock between internal or external oscillator | ||
// e.g: | ||
// sysClock(INT_OSC) for internal oscillator | ||
// sysClock(EXT_OSC) for external crystal | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
sysClock(EXT_OSC); | ||
|
||
pinMode(LED_BUILTIN, OUTPUT); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
digitalToggle(LED_BUILTIN); | ||
} |