forked from LGTMCU/Larduino_HSP
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.Fix adc cannot read full scale detect 2.ADC default 10bit mode 3.Renew examples code
- Loading branch information
nulljun
committed
Jul 3, 2021
1 parent
bcbcf4d
commit 78371c9
Showing
34 changed files
with
200 additions
and
90 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
libraries/BasicsExamples/examples/AnalogRead/AnalogRead.ino
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,26 @@ | ||
//============================================ | ||
// ADC demo for lgt328p | ||
// Nulllab org | ||
// Using new added internal 2.56V reference | ||
// analogReadResolution: | ||
// ADC10BIT ADC12BIT | ||
|
||
// analogReference : | ||
// DEFAULT EXTERNAL INTERNAL1V024 INTERNAL2V048 INTERNAL4V096 | ||
//============================================ | ||
|
||
uint16_t value; | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
analogReadResolution(ADC12BIT); // ADC10BIT default is 10bit | ||
analogReference(INTERNAL2V48); // DEFAULT EXTERNAL INTERNAL1V024 INTERNAL2V048 INTERNAL4V096 | ||
Serial.begin(9600); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
value = analogRead(A0); | ||
Serial.println(value); | ||
delay(1); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,31 @@ | ||
// demo for system clock switch | ||
// using function "sysClock(mode)" to switch | ||
// system clock between internal or external oscillator | ||
// e.g: | ||
// INT_OSC_32K 0 | ||
// INT_OSC_32M 1 | ||
// EXT_OSC_32M 2 | ||
// EXT_OSC_24M 3 | ||
// EXT_OSC_16M 4 | ||
// EXT_OSC_12M 5 | ||
// EXT_OSC_8M 6 | ||
// EXT_OSC_4M 7 | ||
// EXT_OSC_2M 8 | ||
// EXT_OSC_1M 9 | ||
// EXT_OSC_400K 10 | ||
// EXT_OSC_32K 11 | ||
// sysClock(INT_OSC_32M) for internal 32M oscillator | ||
// sysClock(EXT_OSC_16M) for external 16M crystal | ||
|
||
void setup() { | ||
// put your setup code here, to run once: | ||
sysClock(INT_OSC_32M); // Set internal 32M oscillator | ||
sysClockPrescale(SYSCLK_DIV_2); // set clock prescale 0 2 4 8 16 32 64 128 | ||
sysClockOutput(1); // sysclock out put to D8 | ||
pinMode(13, OUTPUT); | ||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
digitalToggle(13); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
name=BasicsExamples | ||
version=0.0.0 | ||
author=LGTMCU | ||
maintainer=LGTMCU | ||
sentence=Example sketches for the Nulllab Arduino Hardware Support Package | ||
paragraph= | ||
category=Other | ||
url=https://github.com/nulllaborg/arduino_nulllab | ||
architectures=avr |
18 changes: 0 additions & 18 deletions
18
libraries/Larduino_HSPExamples/examples/lgt8f328p_sysclock/lgt8f328p_sysclock.ino
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
libraries/Larduino_HSPExamples/examples/lgtdemo/adc_i2v56/adc_i2v56.ino
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.