====== GPIO 최초상태 설정 ======= 라즈베리 파이 는 GPIO최초상태가 ON으로 되어 있습니다. 그래서 CP-IO보드를 사용하면 최초상태에서 모든 출력포트가 ON이 됩니다. 최초상태를 off로 바꾸려면 시스템 파일중 하나를 수정해야 합니다. GPIO의 초기 상태를 변경하는 방법은 /boot폴더의 config.txt의 일부내용을 수정하면, GPIO 초기상태를 변경할수 있습니다. sudo nano /boot/config.txt {{:comfilepi:gpio_init:rpi_gpio_init.png?nolink|}} config.txt 내용 중 아래의 내용이 없거나 다르면 아래 내용과 같이 수정하면 초기상태를 변경 할 수 있습니다. # GPIO37,38,39 : ESD level shifter chip enable gpio=37-39=op,np,dh # Set all GPIO pins to output and low gpio=4-13=ip gpio=16=ip gpio=17-27=op,np,dl {{:comfilepi:gpio_init:rpi_gpio_init_contents.png?nolink}} ip : input / op : output / a0-a5 : Alt0-Alt5 / dh : Driving high(output) / dl : Driving low(output) / pu : Pull up / pd : Pull down /pn/np : No pull [[comfilepi:index|ComfilePi (컴파일 파이)]]