所选硬件对应的库
① SDI-12 库
地址:https://github.com/EnviroDIY/Arduino-SDI-12
########################### # COMPATIBILITY # ########################### This library requires the use of pin change interrupts (PCINT). Not all Arduino boards have the same pin capabilities. The known compatibile pins for common variants are shown below. Arduino Uno: All pins. Arduino Mega or Mega 2560: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69). Arduino Leonardo: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI)
上面为示例代码注释,表示2560可以作为探针信号线连接的引脚,我选的是A11-A15
② 显示屏
地址:http://code.google.com/p/u8glib/
③ SD卡
地址:https://github.com/greiman/SdFat/
mega2560引脚图
上图为mega2560引脚定义图,原图地址:https://www.arduino.cc/en/uploads/Hacking/PinMap2560big.png
选取引脚
硬件单元 | 引脚物理编号(上图黑色) | 引脚逻辑编号(上图红色) | 备注 |
显示屏 | 93 | A4 | 对应LCD屏引脚04,CS (RS) 片选信号,高电平有效 |
显示屏 | 95 | A2 | 对应LCD屏引脚05,SID (R/W) 串行数据输入 |
显示屏 | 94 | A3 | 对应LCD屏引脚06,SCK (E) 串行时钟输入 |
按钮 | 43 | 21 | 上 |
按钮 | 44 | 20 | 确认 |
按钮 | 45 | 19 | 下 |
探针1 | 86 | A11 | 信号 |
探针2 | 85 | A12 | 信号 |
SD卡 | 21 | 51 | SD卡,MOSI |
SD卡 | 19 | 53 | SD卡,SS |
SD卡 | 20 | 52 | SD卡,SCK |
SD卡 | 22 | 50 | SD卡,MISO |
注:上述硬件单元未写所需5V和GND连接
开发环境连接图