Skip to content

Commit

Permalink
add ADC DAC SysClock
Browse files Browse the repository at this point in the history
  • Loading branch information
wemos committed Jun 27, 2018
1 parent 9f19779 commit 81f1ee5
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 0 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions libraries/ADC/_ADC_ .cpp
@@ -0,0 +1 @@
//_ADC_
1 change: 1 addition & 0 deletions libraries/ADC/_ADC_.h
@@ -0,0 +1 @@
//_ADC_
22 changes: 22 additions & 0 deletions libraries/ADC/examples/adc_i2v56/adc_i2v56.ino
@@ -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);
}
1 change: 1 addition & 0 deletions libraries/DAC/_DAC_.cpp
@@ -0,0 +1 @@
//_DAC_
1 change: 1 addition & 0 deletions libraries/DAC/_DAC_.h
@@ -0,0 +1 @@
//_DAC_
22 changes: 22 additions & 0 deletions libraries/DAC/examples/dac0_ramp/dac0_ramp.ino
@@ -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;
}

1 change: 1 addition & 0 deletions libraries/SysClock/_sysclock_.cpp
@@ -0,0 +1 @@
//_sysclock_
1 change: 1 addition & 0 deletions libraries/SysClock/_sysclock_.h
@@ -0,0 +1 @@
//_sysclock_
18 changes: 18 additions & 0 deletions libraries/SysClock/examples/sysclock/sysclock.ino
@@ -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);
}

0 comments on commit 81f1ee5

Please sign in to comment.