//******************************************************************************* //----------------本例程仅供学习使用,未经作者允许,不得用于其他用途。----------- //------------------------版权所有,仿冒必究!----------------------------------- //----------------1.开发环境:Arduino IDE----------------------------------------- //----------------2.测试使用开发板型号:Arduino Leonardo or Arduino UNO R3------- //----------------3.单片机使用晶振:16M------------------------------------------ //----------------4.淘宝网址:http://xmdzpj.taobao.com--------------------------- //----------------5.作者:真红炎神--------------------------------------------- //*******************************************************************************/ #define Pot A0 //定义A0为电位器输入口�������� int PotBuffer = 0; //设个变量�ݻ������ void setup() { Serial.begin(9600); //�波特率为9600 } void loop() { PotBuffer = analogRead(Pot); //读取AD值 Serial.print("Pot = ");//�����打印出Pot = �� Serial.println(PotBuffer);//�����打印出AD值��PotBuffer��ֵ delay(500); //��ʱ500ms }