我正在用 Arduino 制作时钟,我想制作一个按钮来设置时间。所以,只是为了测试,我在模拟输入引脚 0 中插入了一根电线,并编写了两行代码来读取引脚并通过串行打印它,但我得到的只是垃圾。
valm = analogRead(0);
Serial.println(valm);
?j?d?±µ?Ê??jDd?±µ???ºjRd?±µ???ºj?d?±µ?Ê??j?d?±µ?É?ªjRd?±µ?? ?ÊjRd?±µ???Âj?d?±µ????j?d?±µ?É??j Rd?±µ????j?d?±µ???ºj?d? ±µ?É??jRd?±µ????j?d?±µ?Ê?ÊjDd?±µ???Âj?d?±µ????j?d?±µ?É?? jRd?±µ????j?d ?±µ?É?ÂjRd?±µ???Êj?d?±µ???ªj?d?±µ?Ê?Êj$d?±µ?? ?ÂjRd?±µ????j?d?±µ????jdd?±µ????jRd?±µ???Âj?d?± µ?É?ÊjRd?±µ??? ?j?d?±µ?Ò?Êj?d?±µ?É?ÂjRd?±µ????j?d?±µ????j?d?±µ?É??jRd?± µ???Âj?d?±µ???Êj?d?±µ? ??ªj?d?±µ???Êj?d?±µ???ÂjRd?±µ????j?d?±µ????j?d?±µ?É??jRd? ±µ???Âj?d?±µ?Ò?Êj?d?±µ?É?ªj?d?±µ?É? ?jTd?±µ???Âj?d?±µ????j?d?±µ?É??jRd?±µ????j?d?±µ?É?ÂjRd?±µ? ??Êj?d?±µ?É?ªjRd?±µ???Êj?d?±µ???ºj ?d?±µ?È??jTd?±µ????jRd?±µ? ??ªj?d?±µ?È?ÂjTd?±µ?É?ÊjRd?±µ???ªj?d?±µ???Êj?d?±µ???ºj?d?±µ? É??jRd ?±µ???Êj?d?±µ???ªj?d?±µ?É?ÂjPd?±µ???Êj?d?±µ???ªj?d?±µ ?Â?Êj?d?±µ?É?ºjRd?±µ????j?d?±µ?É??jRd?± µ???ªj?d?±µ?Ê?Âj?d?±µ???ÊjRd?±µ???ªj?d?±µ?Ò?Êj?d?±µ???ºjRd?± µ????j?d?±µ???Êj?d?±µ?Ê?ªjdd?±µ? ??ÂjRd?±µ???Âj?d?±µ?É?ªjPd?±µ???Êj?d?±µ????j?d?±µ?É??jRd?±µ? ??Êj?d?±µ?É?ªjdd?±µ???ÂjRd?±µ??? Âj?d?±µ?É?ªjDd?±µ???Êj?d?±µ?Ê??j?d?±µ?É??jRd?±µ???ÊjRd?±µ??? ªj?d?±µ?Ê?ÂjPd?±µ???Âj?d?±µ???ªj ?d?±µ?É?Êjdd?±µ?É??jRd?±µ???? j?d?±µ?É?Êj$d?±µ???ªjRd?±µ???Âj?d?±µ?Â?ÂjTd?±µ???ªj?d?±µ??? Êj?d ?±µ????jRd?±µ????j?d?±µ?É?ÊjTd?±µ???ªjRd?±µ???Âj?d?±µ??? Âj?d?±µ?É?ªjRd?±µ???ÊjRd?±µ?Ò??jTd?± µ????j?d?±µ???Êj
为什么?
编辑:
我已将数字引脚 0 设置为输出,我认为这可能是问题所在,所以我访问了 Arduino 网站并找到了Analog Input Pins页面。
所以我试图从他们说的引脚 14 读取模拟输入引脚 0,但我得到了相同的输出。
顺便说一句,我正在尝试从仅模拟引脚读取,而不是数字引脚。