|
楼主 |
发表于 2019-6-11 16:32:07
|
显示全部楼层
另一個比較範例和結果: - uint16_t value;
- void setup() {
- // put your setup code here, to run once:
- analogReference(INTERNAL1V024);
- pinMode(4, ANALOG);
- // analogWrite(4, 127);
- Serial.begin(115200);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- //value = analogRead(VCCM);
- value = analogRead(DACO);
- Serial.print(value * 1.033);
- Serial.print(" , ");
- delay(1);
- value = analogRead(0);
- Serial.print(value);
- Serial.print(" , ");
- delay(1);
- value = analogRead(1);
- Serial.print(value);
- Serial.print(" , ");
- delay(1);
- value = analogRead(4);
- Serial.print(value);
- Serial.print(" , ");
- delay(1);
- value = analogRead(5);
- Serial.print(value);
- Serial.print(" , ");
- delay(1);
- MCUSR |= (1 << SWDD) ; //disable SWD port to let SSOP20 package AD6 & AD7 working properly
- MCUSR |= (1 << SWDD) ; //second write to confirm disable SWD port
- value = analogRead(6);
- Serial.print(value);
- Serial.print(" , ");
- delay(1);
- value = analogRead(7);
- MCUSR &= ~(1 << SWDD) ; //enable SWD port
- MCUSR &= ~(1 << SWDD) ; //second write to confirm enable SWD port
- Serial.println(value);
- delay(1);
- }
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|