待测。
关机。断电。
插上模块。
通电进入系统。(当然是raspbian)- #!/bin/sh
- # Remove the module blacklist entry so it can be loaded on boot
- sudo sed -i 's/^blacklist i2c-bcm2708/# blacklist i2c-bcm2708/' /etc/modprobe.d/raspi-blacklist.conf
- # Load the module now
- sudo modprobe i2c-bcm2708
- # Notify Linux of the Dallas RTC device
- echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
- # Add the RTC device on boot
- sodo sed -i '/^exit 0$/i\echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device' /etc/rc.local
- exit
复制代码 |